def test_get_parents_no_parents(self): """No parents from the given table""" # Setup parents = {} # Run data_navigator_mock = Mock() data_navigator_mock.parent_map = parents result = DataNavigator.get_parents(data_navigator_mock, 'DEMO') # Asserts expect = set() assert expect == result
def test_get_parents(self): """get_parents returns the relational parent of a table.""" # Setup parents = {'DEMO': {'parent_a': 'foo'}} # Run data_navigator_mock = Mock() data_navigator_mock.parent_map = parents result = DataNavigator.get_parents(data_navigator_mock, 'DEMO') # Asserts expect = {'parent_a': 'foo'} assert expect == result