def test_should_not_contain_non_element(self): rrs = RoundRobinSet([1, 2, 3]) assert 4 not in rrs
def test_should_be_able_to_get_next_if_empty(self): rrs = RoundRobinSet([]) assert next(rrs) is None
def test_should_be_able_to_replace(self): rrs = RoundRobinSet([1, 2, 3]) rrs.replace([3, 4, 5]) assert list(rrs) == [3, 4, 5]
def test_should_repr_as_set(self): rrs = RoundRobinSet([1, 2, 3]) assert repr(rrs) == "{1, 2, 3}"
def test_should_not_be_able_to_remove_non_existing(self): rrs = RoundRobinSet([1, 2, 3]) with self.assertRaises(ValueError): rrs.remove(4)
def test_should_be_able_to_update(self): rrs = RoundRobinSet([1, 2, 3]) rrs.update([3, 4, 5]) assert list(rrs) == [1, 2, 3, 4, 5]
def test_should_be_able_to_discard_non_existing(self): rrs = RoundRobinSet([1, 2, 3]) rrs.discard(4) assert list(rrs) == [1, 2, 3]
def test_should_be_able_to_remove_existing(self): rrs = RoundRobinSet([1, 2, 3]) rrs.remove(2) assert list(rrs) == [1, 3]
def test_should_be_able_to_add_existing(self): rrs = RoundRobinSet([1, 2, 3]) rrs.add(2) assert list(rrs) == [1, 2, 3]
def test_should_be_able_to_clear(self): rrs = RoundRobinSet([1, 2, 3]) rrs.clear() assert list(rrs) == []
def test_should_be_able_to_add_new(self): rrs = RoundRobinSet([1, 2, 3]) rrs.add(4) assert list(rrs) == [1, 2, 3, 4]
def test_should_have_length(self): rrs = RoundRobinSet([1, 2, 3]) assert len(rrs) == 3
def test_should_be_iterable(self): rrs = RoundRobinSet([1, 2, 3]) assert list(iter(rrs)) == [1, 2, 3]
def test_should_be_able_to_get_next_repeatedly_via_old_method(self): rrs = RoundRobinSet([1, 2, 3]) assert rrs.next() == 1 assert rrs.next() == 2 assert rrs.next() == 3 assert rrs.next() == 1
def test_should_be_able_to_get_next_repeatedly(self): rrs = RoundRobinSet([1, 2, 3]) assert next(rrs) == 1 assert next(rrs) == 2 assert next(rrs) == 3 assert next(rrs) == 1