예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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')
예제 #5
0
 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')