(self)
| 107 | assert i.get_name() == "other" |
| 108 | |
| 109 | def test_metaclass(self): |
| 110 | class TestItem(Item): |
| 111 | name = Field() |
| 112 | keys = Field() |
| 113 | values = Field() |
| 114 | |
| 115 | i = TestItem() |
| 116 | i["name"] = "John" |
| 117 | assert list(i.keys()) == ["name"] |
| 118 | assert list(i.values()) == ["John"] |
| 119 | |
| 120 | i["keys"] = "Keys" |
| 121 | i["values"] = "Values" |
| 122 | self.assertSortedEqual(list(i.keys()), ["keys", "values", "name"]) |
| 123 | self.assertSortedEqual(list(i.values()), ["Keys", "Values", "John"]) |
| 124 | |
| 125 | def test_metaclass_with_fields_attribute(self): |
| 126 | class TestItem(Item): |
nothing calls this directly
no test coverage detected