def test_add(self):
     oc = OrderedCollection([1, 2, 3, 4, 5])
     oc.add(6)
     assert [i for i in oc] == [
         1,
         2,
         3,
         4,
         5,
         6,
         ]
     with pytest.raises(TypeError):
         oc.add('not an int')
Beispiel #2
0
 def test_add(self):
     oc = OrderedCollection([1, 2, 3, 4, 5])
     oc.add(6)
     assert [i for i in oc] == [1, 2, 3, 4, 5, 6]
     with raises(TypeError):
         oc.add('not an int')