Exemplo n.º 1
0
def test_deploy(mocker, revision):
    """Test deploy command."""
    mocked_requests = mocker.patch('requests.post')
    log = mock.Mock()
    log.read.return_value = 'some log'
    deploy(
        url='http://example.com', username='******', password='******', status='dpl',
        instance='some_instance', log=log, cases=[123, 232])
    mocked_requests.assert_called_with(
        'http://example.com/api/deployment-reports/',
        headers={'content-type': 'application/json'},
        data='{"cases": [{"id": 123}, {"id": 232}], "instance": {"name": '
        '"some_instance"}, "log": "some log", "status": "dpl"}',
        auth=('user', 'password'))
Exemplo n.º 2
0
def test_deploy(mocker):
    """Test deploy command."""
    mocked_requests = mocker.patch('requests.post')
    log = mock.Mock()
    log.read.return_value = 'some log'
    deploy(
        url='http://example.com', username='******', password='******', status='dpl',
        instance='some_instnace', ci_project='paylogic', log=log, release=1520)
    mocked_requests.assert_called_with(
        'http://example.com/api/deployment-reports/',
        headers={'Content-Type': 'application/json'},
        data='{"instance": {"ci_project": {"name": "paylogic"}, "name": "some_instnace"}, '
        '"log": "some log", "release": {"number": 1520}, "status": "dpl"}',
        auth=('user', 'password'))
Exemplo n.º 3
0
def test_deploy(mocker, revision):
    """Test deploy command."""
    mocked_requests = mocker.patch('requests.post')
    log = mock.Mock()
    log.read.return_value = 'some log'
    deploy(url='http://example.com',
           username='******',
           password='******',
           status='dpl',
           instance='some_instance',
           log=log,
           cases=[123, 232])
    mocked_requests.assert_called_with(
        'http://example.com/api/deployment-reports/',
        headers={'content-type': 'application/json'},
        data='{"cases": [{"id": 123}, {"id": 232}], "instance": {"name": '
        '"some_instance"}, "log": "some log", "status": "dpl"}',
        auth=('user', 'password'))
Exemplo n.º 4
0
def test_deploy(mocker):
    """Test deploy command."""
    mocked_requests = mocker.patch('requests.post')
    log = mock.Mock()
    log.read.return_value = 'some log'
    deploy(url='http://example.com',
           username='******',
           password='******',
           status='dpl',
           instance='some_instnace',
           ci_project='paylogic',
           log=log,
           release=1520)
    mocked_requests.assert_called_with(
        'http://example.com/api/deployment-reports/',
        headers={'Content-Type': 'application/json'},
        data=
        '{"instance": {"ci_project": {"name": "paylogic"}, "name": "some_instnace"}, '
        '"log": "some log", "release": {"number": 1520}, "status": "dpl"}',
        auth=('user', 'password'))