Example #1
0
    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)
Example #2
0
    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))