sintonia/api_client/tests/requestprovider_test.py
Jonas L 30b3470a06
Better format enforcing (#1391)
* Add shared python format-check target

* Add .format-check to api lint target

* Format api code with makefile format target

* Add .format-check to tools lint target

* Add .format-check to analyzer lint target

* Format analyzer code with makefile format target

* Add .format-check to celery lint target

* Add .format-check to api_client lint target

* Format api_client code with makefile format target

* Add .format-check to playout lint target

* Run CI linting in parallel

* Disable isort in pre-commit
2021-10-17 16:24:37 +02:00

34 lines
842 B
Python

import pytest
from api_clients.utils import RequestProvider
from api_clients.version1 import api_config
@pytest.fixture()
def config():
return {
**api_config,
"general": {
"base_dir": "/test",
"base_port": 80,
"base_url": "localhost",
"api_key": "TEST_KEY",
},
"api_base": "api",
}
def test_request_provider_init(config):
request_provider = RequestProvider(config, {})
assert len(request_provider.available_requests()) == 0
def test_request_provider_contains(config):
endpoints = {
"upload_recorded": "/1/",
"update_media_url": "/2/",
"list_all_db_files": "/3/",
}
request_provider = RequestProvider(config, endpoints)
for endpoint in endpoints:
assert endpoint in request_provider.requests