예제 #1
0
def test_notify_deployment_by_name_success():
    """
    Client should be able to notify deployments with application name
    """
    httpretty.register_uri(httpretty.POST,
                           NEW_RELIC_REGEX,
                           body=NOTIFY_DEPLOYMENT_SUCCESS,
                           status=200)
    # When I make an API request to notify of deployment
    c = Client(account_id="1", api_key="2")

    # Then I should receive a valid response
    result = c.notify_deployment(application_name=123,
                                 description='description',
                                 revision='1.2.3',
                                 user='******',
                                 changelog='orange')

    result.should.be.an('dict')

    result.should.have.key('account-id')
    result['account-id'].should.equal('123')

    result.should.have.key('agent-id')
    result['agent-id'].should.equal('456')