예제 #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'