def to_basic(self, value): try: return real_index(self.choices, value) except ValueError: raise WrongFormat('%r is not in %r' % ( value, self.choices, ))
def test_actually_index_can_use_real_index(): t = [set()] assert real_index(t, set()) == 0
def test_actually_index_can_index_past_an_inequal_thing(): t = [frozenset(), set()] assert real_index(t, set()) == 1
def test_actually_index_does_not_index_not_actually_equal_things(): t = [frozenset()] with pytest.raises(ValueError): real_index(t, set())