def test_find_field_none(self): """ Verifies that None is returned when no field is found """ table = TableFactory('test') table.add_fields(['one', 'two']) field = table.find_field('fake_field') self.assertIsNone(field)
def test_find_field_none(self): """ Verifies that None is returned when no field is found """ table = TableFactory("test") table.add_fields(["one", "two"]) field = table.find_field("fake_field") self.assertIsNone(field)
def test_find_field_alias(self): """ Verifies that the correct field is returned when passing an alias """ table = TableFactory('test') table.add_fields(['one', {'my_alias': 'two'}]) field = table.find_field(alias='my_alias') self.assertEqual('my_alias', field.get_identifier()) self.assertEqual(table.fields[1], field)
def test_find_field(self): """ Verifies that the correct field is returned """ table = TableFactory('test') table.add_fields(['one', 'two']) field = table.find_field('one') self.assertEqual('test.one', field.get_identifier()) self.assertEqual(table.fields[0], field)
def test_find_field_alias(self): """ Verifies that the correct field is returned when passing an alias """ table = TableFactory("test") table.add_fields(["one", {"my_alias": "two"}]) field = table.find_field(alias="my_alias") self.assertEqual("my_alias", field.get_identifier()) self.assertEqual(table.fields[1], field)
def test_find_field(self): """ Verifies that the correct field is returned """ table = TableFactory("test") table.add_fields(["one", "two"]) field = table.find_field("one") self.assertEqual("test.one", field.get_identifier()) self.assertEqual(table.fields[0], field)