Skip to content

Commit 292c480

Browse files
committed
fix : tests for default on missing and on dupl
1 parent 32b18f6 commit 292c480

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

test/api/open_fga_api_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,8 @@ async def test_write(self, mock_request):
883883
"relation": "reader",
884884
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
885885
}
886-
]
886+
],
887+
"on_duplicate": "error",
887888
},
888889
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
889890
},
@@ -937,7 +938,8 @@ async def test_write_delete(self, mock_request):
937938
"relation": "reader",
938939
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
939940
}
940-
]
941+
],
942+
"on_missing": "error",
941943
},
942944
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
943945
},

test/client/client_test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3901,9 +3901,17 @@ def client_configuration():
39013901
)
39023902

39033903

3904-
class TestClientConfigurationHeaders:
3904+
class TestClientConfigurationHeaders(IsolatedAsyncioTestCase):
39053905
"""Tests for ClientConfiguration headers parameter"""
39063906

3907+
def setUp(self):
3908+
self.configuration = ClientConfiguration(
3909+
api_url="http://api.fga.example",
3910+
)
3911+
3912+
def tearDown(self):
3913+
pass
3914+
39073915
def test_client_configuration_headers_default_none(self, client_configuration):
39083916
"""Test that headers default to an empty dict in ClientConfiguration"""
39093917
assert client_configuration.headers == {}

test/sync/client/client_test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3880,9 +3880,17 @@ def client_configuration():
38803880
)
38813881

38823882

3883-
class TestSyncClientConfigurationHeaders:
3883+
class TestSyncClientConfigurationHeaders(IsolatedAsyncioTestCase):
38843884
"""Tests for ClientConfiguration headers parameter in sync client"""
38853885

3886+
def setUp(self):
3887+
self.configuration = ClientConfiguration(
3888+
api_url="http://api.fga.example",
3889+
)
3890+
3891+
def tearDown(self):
3892+
pass
3893+
38863894
def test_sync_client_configuration_headers_default_none(self, client_configuration):
38873895
"""Test that headers default to an empty dict in ClientConfiguration"""
38883896
assert client_configuration.headers == {}

test/sync/open_fga_api_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@ def test_write(self, mock_request):
950950
"relation": "reader",
951951
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
952952
}
953-
]
953+
],
954+
"on_duplicate": "error",
954955
},
955956
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
956957
},
@@ -1004,7 +1005,8 @@ def test_write_delete(self, mock_request):
10041005
"relation": "reader",
10051006
"user": "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
10061007
}
1007-
]
1008+
],
1009+
"on_missing": "error",
10081010
},
10091011
"authorization_model_id": "01G5JAVJ41T49E9TT3SKVS7X1J",
10101012
},

0 commit comments

Comments
 (0)