diff options
author | John L. Villalovos <john@sodarock.com> | 2021-11-24 17:43:46 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-11-24 20:41:36 -0800 |
commit | 308210b3dee15c844cd5db4ddd8c7404bb188990 (patch) | |
tree | 4df88a7a967e209afcf2efea9efc5fd8be358128 /tests/unit/test_base.py | |
parent | ab82fd84ba3cecf766915112dcb46fdfab383e73 (diff) | |
download | gitlab-jlvillal/mypy_strict.tar.gz |
WIP: work on enable mypy 'strict' modejlvillal/mypy_strict
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" |