def test_default_route(self):
        self.assertRaises(CommandExecutionError, network.default_route,
                          'family')

        with patch.object(network, 'routes',
                          side_effect=[[{'addr_family': 'inet'},
                                        {'destination': 'A'}], []]):
            with patch.dict(network.__grains__, {'kernel': 'A',
                                                 'os': 'B'}):
                self.assertRaises(CommandExecutionError,
                                  network.default_route, 'inet')

            with patch.dict(network.__grains__, {'kernel': 'Linux'}):
                self.assertListEqual(network.default_route('inet'), [])
Execute a module's code without importing it
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/network_test.py/NetworkTestCase.test_default_route--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/runpy.py/run_module