Skip to content

Commit ef152cc

Browse files
committed
Update existing unittest for custom object creation
Previously this test didn't really test if the implementation was done correctly. This fixes that
1 parent c030a95 commit ef152cc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_service_custom_objects.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,28 @@ def test_custom_object_update(client):
4848
"""Test the return value of the update methods.
4949
5050
It doesn't test the actual update itself.
51-
TODO: See if this is worth testing since we're using a mocking backend
5251
"""
5352
custom_object = client.custom_objects.create_or_update(
5453
types.CustomObjectDraft(container="unittest", key="test-object-1", value=1234)
5554
)
5655
assert custom_object.key == "test-object-1"
56+
assert custom_object.value == 1234
57+
assert custom_object.version == 1
5758

5859
custom_object = client.custom_objects.create_or_update(
5960
types.CustomObjectDraft(container="unittest", key="test-object-1", value=2345)
6061
)
6162
assert custom_object.key == "test-object-1"
63+
assert custom_object.value == 2345
64+
assert custom_object.version == 2
65+
66+
# And another key
67+
custom_object = client.custom_objects.create_or_update(
68+
types.CustomObjectDraft(container="unittest", key="test-object-2", value=3456)
69+
)
70+
assert custom_object.key == "test-object-2"
71+
assert custom_object.value == 3456
72+
assert custom_object.version == 1
6273

6374

6475
def test_custom_object_query_by_container(client):

0 commit comments

Comments
 (0)