"""Tests for ows_royalties connector.""" import httpx from owsclient.test import OwsClientMock from src.connectors import ows_royalties def test_create_statement_period_adjustment_file( ows_client_mock: OwsClientMock, ) -> None: """Test successful create file.""" mock_response = { 'file_name': 'Test file.csv', 'valid_file_location': 's3://bucket/file.csv', 'invalid_file_location': None, 'valid_row_count': None, 'invalid_row_count': None, 'total_file_amount_multicurrency': None, 'total_rounded_amount_multicurrency': None, 'md5sum': None, 'error_type': None, 'statement_period_adjustment_file_id': 5, 'statement_period_id': 325, 'source_file_upload_id': 110, } statement_period_id = 324 file_data = { 'file_name': 'Test file.csv', 'valid_file_location': 's3://bucket/file.csv', 'source_file_upload_id': 110, } ows_client_mock.post( 'ows-royalties', f'/statement-period/{statement_period_id}/adjustment-file', json=file_data, ).mock( return_value=httpx.Response( 201, json=mock_response, ) ) response = ows_royalties.create_statement_period_adjustment_file( statement_period_id, file_data ) assert response.status_code == 201 assert response.json() == mock_response