"""Test ows-abacus-state connector.""" import httpx from owsclient.test import OwsClientMock from src.connectors import ows_abacus_state def test_create_abacus_state( ows_client_mock: OwsClientMock, ) -> None: """Test successful create abacus state.""" test_table = 'test_table' test_table_id = '1' contract_type = 'upload_file' mock_response = [ { 'abacus_state_id': 17, 'parent_table_id': test_table_id, 'parent_table_name': test_table, 'action_name': contract_type, 'action_status': 'init', 'message': None, 'created_by': 'default_user_id', 'created_at': '2026-01-07T15:37:38.000000', 'last_modified_by': 'default_user_id', 'last_modified': '2026-01-07T15:37:38.000000', }, ] ows_client_mock.post( 'ows-abacus-state', f'/abacus-states/{test_table}/{test_table_id}?contract_type={contract_type}', ).mock( return_value=httpx.Response( 201, json=mock_response, ) ) response = ows_abacus_state.create_abacus_state( test_table, test_table_id, contract_type ) assert response.status_code == 201 assert response.json() == mock_response