def test_remove(self):
        oc = OrderedCollection([1, 2, 3, 4, 5])
        with raises(KeyError):
            oc.remove(s_id(6))
        oc.remove(s_id(4))
        assert [i for i in oc] == [1, 2, 3, 5]

        oc.remove(2)
        assert [i for i in oc] == [1, 2, 5]
Beispiel #2
0
    def test_remove(self):
        oc = OrderedCollection([1, 2, 3, 4, 5])
        with raises(KeyError):
            oc.remove(s_id(6))
        oc.remove(s_id(4))
        assert [i for i in oc] == [1, 2, 3, 5]

        oc.remove(2)
        assert [i for i in oc] == [1, 2, 5]