def test_gateways(self): route_lines = FAKE_ROUTE_TABLE_GOOD.splitlines() expected = {'default': {route.AF_INET: ('5.10.3.2', 'eth0')}} actual = route.gateways(route_lines) self.assertDictEqual(expected, actual)
def test_gateways_returns_empty_result_when_gateway_is_missing(self): route_lines = FAKE_ROUTE_TABLE_NO_DEFAULT_ROUTE.splitlines() self.assertDictEqual({}, route.gateways(route_lines))