Example #1
0
    def test_file_get_warning(self, exists_mock, warn_mock, path_exists_mock):
        remote_path = "/a/b"
        local_path = "/c/d"
        env.host = "remote_host"
        exists_mock.return_value = False
        path_exists_mock.return_value = True

        collect.file_get(remote_path, local_path)

        exists_mock.assert_called_with(remote_path, True)
        warn_mock.assert_called_with("remote path " + remote_path +
                                     " not found on " + env.host)
Example #2
0
    def test_file_get_warning(self, exists_mock, warn_mock, path_exists_mock):
        remote_path = "/a/b"
        local_path = "/c/d"
        env.host = "remote_host"
        exists_mock.return_value = False
        path_exists_mock.return_value = True

        collect.file_get(remote_path, local_path)

        exists_mock.assert_called_with(remote_path, True)
        warn_mock.assert_called_with("remote path " + remote_path +
                                     " not found on " + env.host)
Example #3
0
    def test_file_get(self, exists_mock, get_mock, path_exists_mock):
        remote_path = "/a/b"
        local_path = "/c/d"
        env.host = "myhost"
        path_with_host_name = path.join(local_path, env.host)
        exists_mock.return_value = True
        path_exists_mock.return_value = True

        collect.file_get(remote_path, local_path)

        exists_mock.assert_called_with(remote_path, True)
        get_mock.assert_called_with(remote_path, path_with_host_name, True)
Example #4
0
    def test_file_get(self, exists_mock, get_mock, path_exists_mock):
        remote_path = "/a/b"
        local_path = "/c/d"
        env.host = "myhost"
        path_with_host_name = path.join(local_path, env.host)
        exists_mock.return_value = True
        path_exists_mock.return_value = True

        collect.file_get(remote_path, local_path)

        exists_mock.assert_called_with(remote_path, True)
        get_mock.assert_called_with(remote_path, path_with_host_name, True)