Esempio n. 1
0
 def test_pop(self):
     example = DataClass(a=1, b=2)
     assert example.pop("a") == 1
     assert ["b"] == list(example.keys())
     with pytest.raises(KeyError):
         _ = example.pop("a")
     assert example.pop("a", 100) == 100
Esempio n. 2
0
 def test_clear(self):
     data = DataClass(a=1, b=2)
     data.clear()
     assert list(data.keys()) == []