6
6
from infrahub .lock_getter import (
7
7
_get_kinds_to_lock_on_object_mutation ,
8
8
_hash ,
9
- _should_kind_be_locked_on_any_branch ,
10
9
get_lock_names_on_object_mutation ,
11
10
)
12
11
from tests .helpers .test_app import TestInfrahubApp
@@ -48,19 +47,7 @@ async def test_lock_other_branch(
48
47
schema_branch = registry .schema .get_schema_branch (name = other_branch .name )
49
48
50
49
person = await create_and_save (db = db , schema = "TestPerson" , name = "John" , branch = other_branch )
51
- assert get_lock_names_on_object_mutation (person , branch = other_branch , schema_branch = schema_branch ) == []
52
-
53
- async def test_lock_groups_on_other_branches (
54
- self ,
55
- db : InfrahubDatabase ,
56
- default_branch ,
57
- client ,
58
- register_core_models_schema ,
59
- ):
60
- other_branch = await create_branch (branch_name = "other_branch" , db = db )
61
- schema_branch = registry .schema .get_schema_branch (name = other_branch .name )
62
-
63
- assert _should_kind_be_locked_on_any_branch (kind = "CoreGraphQLQueryGroup" , schema_branch = schema_branch ) is True
50
+ assert get_lock_names_on_object_mutation (person , schema_branch = schema_branch ) == ["global.object.TestPerson." + _hash ("John" )]
64
51
65
52
async def test_lock_names_only_attributes (
66
53
self ,
@@ -78,7 +65,7 @@ async def test_lock_names_only_attributes(
78
65
schema_branch = registry .schema .get_schema_branch (name = default_branch .name )
79
66
person = await create_and_save (db = db , schema = "TestPerson" , name = "John" )
80
67
car = await create_and_save (db = db , schema = "TestCar" , name = "mercedes" , color = "blue" , owner = person )
81
- assert get_lock_names_on_object_mutation (car , branch = default_branch , schema_branch = schema_branch ) == [
68
+ assert get_lock_names_on_object_mutation (car , schema_branch = schema_branch ) == [
82
69
"global.object.TestCar." + _hash ("mercedes" ) + "." + _hash ("blue" )
83
70
]
84
71
@@ -95,6 +82,6 @@ async def test_lock_names_optional_empty_attribute(
95
82
96
83
schema_branch = registry .schema .get_schema_branch (name = default_branch .name )
97
84
person = await create_and_save (db = db , schema = "TestPerson" , name = "John" )
98
- assert get_lock_names_on_object_mutation (person , branch = default_branch , schema_branch = schema_branch ) == [
85
+ assert get_lock_names_on_object_mutation (person , schema_branch = schema_branch ) == [
99
86
"global.object.TestPerson." + _hash ("" ) + "." + _hash ("John" )
100
87
]
0 commit comments