示例#1
0
def test_add():
    responses.add(responses.POST,
                  'http://api/v2/licenses/projects/666',
                  json=answers.LICENSES_CREATE)
    manager = LicenseManager(client)

    licenses = manager.add(project_id=666, licenses=params.licenses)

    assert len(licenses) > 0
示例#2
0
def test_licenses_partial_resp():
    responses.add(responses.POST,
                  'http://api/v2/licenses/projects/666',
                  json=answers.LICENSES_PARTIAL,
                  status=207)
    manager = LicenseManager(client)

    licenses = manager.add(project_id=666, licenses=params.licenses)

    assert len(licenses) == 1
    assert [lic._info for lic in licenses] == answers.LICENSES_PARTIAL_RESULT