diff options
Diffstat (limited to 'tests/unit/test_base.py')
-rw-r--r-- | tests/unit/test_base.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/unit/test_base.py b/tests/unit/test_base.py index 137f480..902d9b4 100644 --- a/tests/unit/test_base.py +++ b/tests/unit/test_base.py @@ -117,8 +117,8 @@ class TestRESTObject: obj.id = 42 assert 42 == obj.get_id() - obj.id = None - assert obj.get_id() is None + obj.id = "hello" + assert "hello" == obj.get_id() def test_custom_id_attr(self, fake_manager): class OtherFakeObject(FakeObject): @@ -127,6 +127,13 @@ class TestRESTObject: obj = OtherFakeObject(fake_manager, {"foo": "bar"}) assert "bar" == obj.get_id() + def test_custom_id_attr_missing(self, fake_manager): + class OtherFakeObject(FakeObject): + _id_attr = "spam" + + obj = OtherFakeObject(fake_manager, {"foo": "bar"}) + assert obj.get_id() is None + def test_update_attrs(self, fake_manager): obj = FakeObject(fake_manager, {"foo": "bar"}) obj.bar = "baz" |