"""Test request methods.""" import httpx from owsclient.test import OwsClientMock from ledger_accounting_run_balance import requests def test_get(ows_client_mock: OwsClientMock): """Test get method.""" service = 'ows-service' path = '/object/object_id' options = {'headers': {'foo': 'bar'}} route = ows_client_mock.get( service, path, **options) ows_client_mock.get(service, path, **options) route.mock( return_value=httpx.Response(200, json={'message': 'OK'}) ) result = requests.get(path=path, service=service, **options) assert result.status_code == 200 assert result.json() == {'message': 'OK'} assert route.call_count == 1