def test_get_project_none(testspace_api):
    token = testspace_api.token
    url = testspace_api.url
    project = None
    testspace_api_none_project = ts.Testspace(token, url)

    with pytest.raises(Exception):
        testspace_api_none_project.get_project(project)
def test_url():
    token = "abcxyzfortesting"
    url = "abccorp.testspace.com"
    project = "abccorp:application"
    space = "master"
    protocol = "https"

    testspace = ts.Testspace(token, url, project, space)
    assert testspace.url == "{}://{}".format(protocol, url)
def test_get_api_endpoints_username_password(load_json, requests_mock):
    token = "absmith:passfortesting"
    url = "abccorp.testspace.com"
    testspace_url = "https://{}/api".format(url)

    testspace_api = ts.Testspace(token, url)

    requests_mock.get(testspace_url, json=load_json)
    response_json = testspace_api.get_api_endpoints()

    assert response_json == load_json
def testspace_api():
    token = "abcxyzfortesting"
    url = "abccorp.testspace.com"
    project = "abccorp:application"
    space = "master"
    return ts.Testspace(token, url, project, space)
Esempio n. 5
0
def test_push_project_none():
    testspace = ts.Testspace("abcxyzfortesting", "example.testspace.com", None,
                             "random")
    with pytest.raises(ValueError):
        testspace.push("results.xml")