def test_deploy_is_called(self, mock_put, mock_sudo): env.host = 'any_host' package.deploy('/any/path/rpm') mock_sudo.assert_called_with('mkdir -p ' + constants.REMOTE_PACKAGES_PATH) mock_put.assert_called_with('/any/path/rpm', constants.REMOTE_PACKAGES_PATH, use_sudo=True)
def test_deploy_is_called(self, mock_put, mock_sudo): env.host = "any_host" package.deploy("/any/path/rpm") mock_sudo.assert_called_with("mkdir -p " + constants.REMOTE_PACKAGES_PATH) mock_put.assert_called_with("/any/path/rpm", constants.REMOTE_PACKAGES_PATH, use_sudo=True)
def test_deploy_with_fallback_location(self, mock_put, mock_sudo): env.host = 'any_host' package.deploy('/any/path/rpm') mock_put.return_value = lambda: None setattr(mock_put.return_value, 'succeeded', False) package.deploy('/any/path/rpm') mock_put.assert_called_with('/any/path/rpm', constants.REMOTE_PACKAGES_PATH, use_sudo=True, temp_dir='/tmp')