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