def test_get_actions_empty(*args):
    responses.add(responses.GET,
                  'http://shiptest/actions',
                  body="[]",
                  status=200)
    response = GetActions(stubs.StubCliContext()).invoke_and_return_resp()
    assert 'None' in response
    assert 'Lifecycle' in response
示例#2
0
def test_get_actions(*args):
    responses.add(responses.GET,
                  'http://shiptest/actions',
                  body=GET_ACTIONS_API_RESP,
                  status=200)
    response = GetActions(stubs.StubCliContext()).invoke_and_return_resp()
    assert 'deploy_site' in response
    assert 'action/01BTP9T2WCE1PAJR2DWYXG805V' in response
    assert 'Lifecycle' in response
def test_get_actions_unparseable_note(*args):
    responses.add(responses.GET,
                  'http://shiptest/actions',
                  body=GET_ACTIONS_API_RESP_UNPARSEABLE_NOTE,
                  status=200)
    response = GetActions(stubs.StubCliContext()).invoke_and_return_resp()
    assert 'deploy_site' in response
    assert 'action/01BTP9T2WCE1PAJR2DWYXG805V' in response
    assert 'Lifecycle' in response
    assert 'This is the first note for some action' in response
    assert "{'note_val': 'This note is broken'}" in response
    assert 'The previous note is bad' in response
def test_get_actions(*args):
    responses.add(responses.GET,
                  'http://shiptest/actions',
                  body=GET_ACTIONS_API_RESP,
                  status=200)
    response = GetActions(stubs.StubCliContext()).invoke_and_return_resp()
    assert 'deploy_site' in response
    assert 'action/01BTP9T2WCE1PAJR2DWYXG805V' in response
    assert 'Lifecycle' in response
    assert '2/1/0' in response
    assert 'This is a note for the concurrency check' not in response
    assert "Action Footnotes" in response
    assert ("  - Info available with 'describe notedetails/"
            "ABCDEFGHIJKLMNOPQRSTUVWXYA'") in response
示例#5
0
def get_actions(ctx):

    click.echo(GetActions(ctx).invoke_and_return_resp())