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