示例#1
0
def test_url_with_endpoint_with_path():
    api = BaseAPI(2)
    assert api._url('facts', path='osfamily') == ('http://localhost:8080/'
                                                  'v2/facts/osfamily')
示例#2
0
def test_url_with_unknown_endpoint():
    api = BaseAPI(2)
    with pytest.raises(APIError):
        api._url('bananas')
示例#3
0
def test_url_with_endpoint():
    api = BaseAPI(2)
    assert api._url('fact-names') == 'http://localhost:8080/v2/fact-names'
示例#4
0
def test_url_with_endpoint_with_path():
    api = BaseAPI(2)
    assert api._url('facts', path='osfamily') == ('http://localhost:8080/'
                                                  'v2/facts/osfamily')
示例#5
0
def test_url_with_unknown_endpoint():
    api = BaseAPI(2)
    with pytest.raises(APIError):
        api._url('bananas')
示例#6
0
def test_url_with_endpoint():
    api = BaseAPI(2)
    assert api._url('fact-names') == 'http://localhost:8080/v2/fact-names'