def test_execute_command_in_default_namespace(self, check_output): namespace = Namespace(Namespace.DEFAULT_NAMESPACE_NAME) execute_command("command arg1 arg2", namespace=namespace) check_output.assert_called_once_with("command arg1 arg2", shell=True)
def test_execute_command_in_string_namespace(self, check_output): namespace = "namespace" execute_command("command arg1 arg2", namespace=namespace) check_output.assert_called_once_with("ip netns exec namespace command arg1 arg2", shell=True)
def test_execute_command(self, check_output): execute_command("command arg1 arg2") check_output.assert_called_once_with("command arg1 arg2", shell=True)