def test_backend_type_list_yields_all_attributes_after_id(self): cat = Category(None, None, None, None, None, None) attrs = self._mock_attributes() cat.attrs = attrs # This is a bit abusive, could add each attr via the public interface results = cat.backend_type_list() results.next() # Discard id for attr in attrs.values(): try: name, type_name = results.next() except StopIteration: self.fail('Not enough results returned from backend_type_list') assert_that(name, is_(attr.name)) assert_that(type_name, is_(attr.type_name))
def test_backend_type_list_yields_all_attributes_after_id(self): cat = Category(None, None, None, None, None, None) attrs = self._mock_attributes() cat.attrs = attrs # This is a bit abusive, could add each attr via the public interface results = cat.backend_type_list() results.next() # Discard id for attr in attrs.values(): try: name, type_name = results.next() except StopIteration: self.fail('Not enough results returned from backend_type_list') assert_that(name, is_(attr.name)) assert_that(type_name, is_(attr.type_name))
def test_backend_type_list_yields_all_collections_after_attributes(self): cat = Category(None, None, None, None, None, None) attrs = self._mock_attributes() colls = self._mock_collections() cat.attrs = attrs # This is a bit abusive, could add each attr via the public interface cat.colls = colls # This is a bit abusive, could add each coll via the public interface results = cat.backend_type_list() # Discard id and attributes results.next() for _ in attrs.values(): results.next() for coll in colls.keys(): try: name, type_name = results.next() except StopIteration: self.fail('Not enough results returned from backend_type_list') assert_that(name, is_(coll)) assert_that(type_name, is_('string'))
def test_backend_type_list_yields_all_collections_after_attributes(self): cat = Category(None, None, None, None, None, None) attrs = self._mock_attributes() colls = self._mock_collections() cat.attrs = attrs # This is a bit abusive, could add each attr via the public interface cat.colls = colls # This is a bit abusive, could add each coll via the public interface results = cat.backend_type_list() # Discard id and attributes results.next() for _ in attrs.values(): results.next() for coll in colls.keys(): try: name, type_name = results.next() except StopIteration: self.fail('Not enough results returned from backend_type_list') assert_that(name, is_(coll)) assert_that(type_name, is_('string'))
def test_that_backend_type_list_yields_id_first(self): cat = Category(None, None, None, None, None, None) name, type_name = cat.backend_type_list().next() assert_that(name, is_('id')) assert_that(type_name, is_('string'))
def test_that_backend_type_list_yields_id_first(self): cat = Category(None, None, None, None, None, None) name, type_name = cat.backend_type_list().next() assert_that(name, is_('id')) assert_that(type_name, is_('string'))