Exemplo n.º 1
0
    def test_pull_file(self):
        multipass = Multipass(project=self.project, echoer=self.echoer_mock)

        multipass.pull_file("src.txt", "dest.txt")

        self.multipass_cmd_mock().execute.assert_called_once_with(
            command=[
                "sudo",
                "-i",
                "env",
                "SNAPCRAFT_HAS_TTY=False",
                "test",
                "-f",
                "src.txt",
            ],
            hide_output=False,
            instance_name="snapcraft-project-name",
        )

        self.multipass_cmd_mock().copy_files.assert_called_once_with(
            destination="dest.txt", source="{}:src.txt".format(self.instance_name)
        )

        self.multipass_cmd_mock().info.assert_not_called()
        self.multipass_cmd_mock().stop.assert_not_called()
        self.multipass_cmd_mock().delete.assert_not_called()
Exemplo n.º 2
0
    def test_pull_file(self):
        multipass = Multipass(project=self.project, echoer=self.echoer_mock)

        multipass.pull_file("src.txt", "dest.txt")

        self.multipass_cmd_mock().execute.assert_called_once_with(
            command=["test", "-f", "src.txt"],
            instance_name="snapcraft-project-name")

        self.multipass_cmd_mock().copy_files.assert_called_once_with(
            destination="dest.txt",
            source="{}:src.txt".format(self.instance_name))

        self.multipass_cmd_mock().info.assert_not_called()
        self.multipass_cmd_mock().stop.assert_not_called()
        self.multipass_cmd_mock().delete.assert_not_called()