actualresult = requests.post(f'{host}:{port.eAccess}/command2', json=payload).json() response.error['result'] = [{ "code": "VR-10.1.4.1", "description": "Entity 'TenderProcessEntity' not found by cpid = '" + cpid + "' and stage = 'EV'", }] assert actualresult == response.error @pytest.mark.parametrize("param", [ pytest.param("authority", marks=pytestrail.case('C16895'), id="if businessFunctions.type as authority"), pytest.param("", marks=pytestrail.case('C16874'), id="if businessFunctions.type as empty string"), ]) def test_responderProcessing_mismatch_with_one_of_enum_expected_values( port, host, param, response, prepared_cpid, payload_responderProcessing, prepare_data): responder = prepare_data(schema=schema_responder) responder['businessFunctions'][0]['type'] = param payload = payload_responderProcessing(cpid=prepared_cpid, responder=responder, date=ocds_datetime()) actualresult = requests.post(f'{host}:{port.eAccess}/command2',
import pytest from pytest_testrail.plugin import pytestrail import requests from uuid import uuid4 @pytest.mark.parametrize("param, value", [ pytest.param("number", 22.3, marks=pytestrail.case("C14118"), id="value dataType is number"), pytest.param("integer", 22, marks=pytestrail.case("C14119"), id="value dataType is integer"), pytest.param("boolean", False, marks=pytestrail.case("C14120"), id="value dataType is boolean"), pytest.param("string", "30", marks=pytestrail.case("C14121"), id="value dataType is string") ]) def test_validateRequirementResponse_check_of_the_validation( host, port, execute_insert_into_dossier_tenders, prepared_cpid, data_create_criteria, prepared_owner,
import pytest import requests from pytest_testrail.plugin import pytestrail action_enum = ('findLotIds', 'checkAccessToTender', 'getLotStateByIds', 'responderProcessing', 'checkPersonesStructure', 'getTenderState', 'setStateForLots', 'setStateForTender') @pytest.mark.parametrize("param,value,code,description", [ pytest.param("version", 3.14, "DR-2/3", "Data type mismatch." " Expected data type: 'STRING', actual data type: 'NUMBER'.", marks=pytestrail.case('C8642')), pytest.param("version", True, "DR-2/3", "Data type mismatch." " Expected data type: 'STRING', actual data type: 'BOOLEAN'.", marks=pytestrail.case('C8645')), pytest.param("version", "", "DR-4/3", "Data format mismatch." " Expected data format: '00.00.00', actual value: ''.", marks=pytestrail.case('C8466')), pytest.param("id", 3.14, "DR-2/3", "Data type mismatch." " Expected data type: 'STRING', actual data type: 'NUMBER'.", marks=pytestrail.case('C8643')),
payload = payload_notice_compiled_release(data=json_data) actualresult = requests.post(f'{host}:{port.eNotice}/command2', json=payload).json() result = execute_select_notice_compiled_release( cpid=prepared_cpid, ocid=prepared_ev_ocid).one() amendment_db = json.loads(result.json_data)['tender']['amendments'][0] amendment_request = json.loads( payload['params']['data'])['tender']['amendments'][0] del amendment_request['token'] check.equal(amendment_request, amendment_db) check.equal(actualresult, response.success) @pytest.mark.parametrize("param", [ pytest.param("description", marks=pytestrail.case('C8256')), pytest.param("documents", marks=pytestrail.case('C8257')) ]) def test_on_a_possibility_to_update_record_without_params_tender_amendments_description( host, port, param, execute_insert_into_notice_compiled_release, prepared_cpid, prepared_ev_ocid, prepared_release_id, payload_notice_compiled_release, execute_select_notice_compiled_release, data_for_test_notice_compiled_release, prepared_data_add_EV_before_SendAcForVerification, response): data = prepared_data_add_EV_before_SendAcForVerification execute_insert_into_notice_compiled_release(cp_id=prepared_cpid, oc_id=prepared_ev_ocid, json_data=data, publish_date=datetime.now(), release_date=datetime.now(),
cp_id=prepared_cpid, stage=stage, token_entity=prepared_token_entity).one() actual_award = json.loads(record.json_data) assert actual_award['requirementResponses'][1] == payload['params'][ 'award']['requirementResponse'] @pytest.mark.parametrize("name,param,value,code,description", [ pytest.param('awardId', 'id', '', "DR-4/7", "Data format mismatch of attribute 'awardId'." " Expected data format: 'uuid', actual value: ''.", id='awardId as empty string', marks=pytestrail.case('C13266')) ]) def test_addRequirementResponse_data_format_mismatch_of_attribute_awardId( port, host, name, param, value, code, description, prepared_entity_id, payload_addRequirementResponse, response): payload = payload_addRequirementResponse( award_id=prepared_entity_id(), requirementResponse_id=prepared_entity_id(), relatedTenderer_id=prepared_entity_id(), requirement_id=prepared_entity_id()) payload['params']['award'][param] = value actualresult = requests.post(f'{host}:{port.eEvaluation}/command2', json=payload).json() response.error['result'] = [{ "code": code, "description": description,
import json import pytest import requests from pytest_testrail.plugin import pytestrail from resources.domain.amendment import schema_amendment @pytest.mark.parametrize("status", [ pytest.param("active", marks=pytestrail.case('C16968')), pytest.param("cancelled", marks=pytestrail.case('C16969')), ]) def test_setStateForAmendment_valid_status( port, host, status, prepared_cpid, prepared_ev_ocid, prepare_data, execute_insert_into_revision_amendments, execute_select_revision_amendments_by_id, prepared_entity_id, payload_setStateForAmendment, response): amendment_id = prepared_entity_id() data = prepare_data(schema=schema_amendment) data['id'] = str(amendment_id) execute_insert_into_revision_amendments(cpid=prepared_cpid, ocid=prepared_ev_ocid, id=amendment_id, data=data) payload = payload_setStateForAmendment(amendmentId=amendment_id, status=status) actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json() response.success['result'] = {'id': str(amendment_id), "status": status}
response.error['result'] = [{ 'code': 'DR-4/7', 'description': "Data format mismatch of attribute 'lotIds'." " Expected data format: 'uuid', actual value: ''.", 'details': [{ 'name': 'lotIds' }] }] assert actualresult == response.error @pytest.mark.parametrize("param", [ pytest.param('cpid', marks=pytestrail.case('C16896')), pytest.param('ocid', marks=pytestrail.case('C16897')), pytest.param('lotIds', marks=pytestrail.case('C16898')), pytest.param('date', marks=pytestrail.case('C16899')) ]) def test_createUnsuccessfulAwards_request_does_not_contain_required_param( port, host, param, payload_createUnsuccessfulAwards, response): payload = payload_createUnsuccessfulAwards() del payload['params'][param] actualresult = requests.post(f'{host}:{port.eEvaluation}/command2', json=payload).json() response.error['result'] = [{ 'code': 'RQ-1/7', 'description': "Error parsing 'params'" }]
port, host, payload_closeAwardPeriod, execute_insert_into_evaluation_period, prepared_cpid, response): end_date = ocds_datetime() execute_insert_into_evaluation_period(cp_id=prepared_cpid, stage='EV') payload = payload_closeAwardPeriod(cpid=prepared_cpid, endDate=end_date) actualresult = requests.post(f'{host}:{port.eEvaluation}/command2', json=payload).json() response.error['result'] = [{ 'code': 'VR-10.4.6.1/7', 'description': 'Period not found.' }] assert actualresult == response.error @pytest.mark.parametrize("param", [ pytest.param('cpid', marks=pytestrail.case('C16927')), pytest.param('ocid', marks=pytestrail.case('C16928')), pytest.param('endDate', marks=pytestrail.case('C16929')) ]) def test_closeAwardPeriod_request_does_not_contain_param( port, host, param, payload_closeAwardPeriod, response): payload = payload_closeAwardPeriod() del payload['params'][param] actualresult = requests.post(f'{host}:{port.eEvaluation}/command2', json=payload).json() response.error['result'] = [{ 'code': 'RQ-1/7', 'description': "Error parsing 'params'" }]
json=payload).json() response.error['result'] = [{ "code": "RQ-02/3", "description": "Can not parse 'params'." }] assert actualresult == response.error @pytest.mark.parametrize("param,value,code,description", [ pytest.param('cpid', '', "DR-5/3", "Data mismatch to pattern:" " '^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-[0-9]{13}$'." " Actual value: ''.", id='cpid', marks=pytestrail.case('C13299')), pytest.param('ocid', '', "DR-5/3", "Data mismatch to pattern:" " '^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-" "[0-9]{13}-(AC|EI|EV|FS|NP|PN)-[0-9]{13}$'." " Actual value: ''.", id='ocid', marks=pytestrail.case('C13300')) ]) def test_checkPersonesStructure_if_data_of_attribute_mismatch_to_the_pattern( host, port, param, value, code, description, payload_checkPersonesStructure, data_person, response): payload = payload_checkPersonesStructure(locationOfPersones='award') payload['params'][param] = value actualresult = requests.post(f'{host}:{port.eAccess}/command2',
) actualresult = requests.post(f'{host}:{port.eEvaluation}/command2', json=payload).json() response.error['result'] = [ { "code": "VR-10.4.4.2/7", "description": "Tenderer is not linked to award." } ] assert actualresult == response.error @pytest.mark.parametrize("param, value", [ pytest.param("cpid", "ocds-t1s2t3-MD-0000000000000", marks=pytestrail.case('C13252'), id="by cpid"), pytest.param("ocid", "ocds-t1s2t3-MD-0000000000000-AC-0000000000000", marks=pytestrail.case('C16590'), id="by stage"), pytest.param("awardId", f"{uuid4()}", marks=pytestrail.case('C16637'), id="by award.id"), ]) def test_checkRelatedTenderer_award_not_found(host, port, param, value, payload_checkRelatedTenderer, response, execute_insert_into_evaluation_award, prepared_entity_id, prepared_cpid, prepared_tenderer_id, prepared_token_entity, data_award, prepared_owner):
token_entity=prepared_token_entity, created_date=datetime.now(), json_data=data, owner=prepared_owner) payload = payload_checkAccessToTender() actualresult = requests.post(f'{host}:{port.eAccess}/command2', json=payload).json() assert actualresult == response.success @pytest.mark.parametrize("param,value,code", [ pytest.param("owner", f"{uuid4()}", "VR-10.1.1.2/3", marks=pytestrail.case('C8405'), id="request contains token which is not present in the DB"), pytest.param("token", f"{uuid4()}", "VR-10.1.1.1/3", marks=pytestrail.case('C8406'), id="request contains owner which is not present in the DB") ]) def test_checkAccessToTender_does_not_access_to_tender( port, host, param, value, prepared_cpid, code, prepared_token_entity, prepared_owner, response, data_tender, payload_checkAccessToTender, execute_insert_into_access_tender, clear_access_tender_by_cpid): data = data_tender data['ocid'] = prepared_cpid execute_insert_into_access_tender(cp_id=prepared_cpid, stage='EV',
import pytest import requests from pytest_testrail.plugin import pytestrail action_enum = ("findAmendmentIds", "dataValidation", "createAmendment", "CheckAccessToAmendment", "getAmendmentByIds", "setStateForAmendment") @pytest.mark.parametrize("param,value,code,description", [ pytest.param("version", 3.14, "DR-2/21", "Data type mismatch of attribute 'version'." " Expected data type: 'STRING', actual data type: 'NUMBER'.", marks=pytestrail.case('C8235', 'C8131', 'C8379'), id="version as number."), pytest.param("version", True, "DR-2/21", "Data type mismatch of attribute 'version'." " Expected data type: 'STRING', actual data type: 'BOOLEAN'.", marks=pytestrail.case('C8236', 'C8130', 'C8380'), id="version as boolean."), pytest.param("version", "", "DR-4/21", "Data format mismatch of attribute 'version'." " Expected data format: '00.00.00', actual value: ''.", marks=pytestrail.case('C8234', 'C8132', 'C8382'), id="version as empty str."), pytest.param("version", None,
import pytest import requests from pytest_testrail.plugin import pytestrail action_enum = "updateRecord" @pytest.mark.parametrize("param,value,code,description", [ pytest.param("version", 3.14, "DR-2/2", "Data type mismatch of attribute 'version'." " Expected data type: 'STRING', actual data type: 'NUMBER'.", marks=pytestrail.case('C8241'), id="version as number."), pytest.param("version", True, "DR-2/2", "Data type mismatch of attribute 'version'." " Expected data type: 'STRING', actual data type: 'BOOLEAN'.", marks=pytestrail.case('C8239'), id="version as boolean."), pytest.param("version", "", "DR-4/2", "Data format mismatch of attribute 'version'." " Expected data format: '00.00.00', actual value: ''.", marks=pytestrail.case('C8242'), id="version as empty str."), # pytest.param("version", None, "DR-2/2", # "Data type mismatch of attribute 'version'." # " Expected data type: 'not null', actual data type: 'null'.", # marks=pytestrail.case(), id="version as null."), # pytest.param("version", "99.0.a", "DR-4/2", # "Data format mismatch of attribute 'version'." # " Expected data format: '00.00.00', actual value: '99.0.a'.", # marks=pytestrail.case(), id="version as '99.0.a'."), pytest.param("id", 3.14, "DR-2/2", "Data type mismatch of attribute 'id'."
}, { 'statusDetails': states[1][1] }] actualresult = requests.post(f'{host}:{port.eContracting}/command2', json=payload).json() del can_ids[2] actualresult['result'].sort() can_ids.sort() assert actualresult['status'] == "success" assert actualresult['result'] == [str(can_id) for can_id in can_ids] @pytest.mark.parametrize("param", [ pytest.param("cpid", marks=pytestrail.case('C16949')), pytest.param("ocid", marks=pytestrail.case('C16950')) ]) def test_findCANIds_without_required_param(port, host, param, payload_findCANIds, response): payload = payload_findCANIds() del payload['params'][param] actualresult = requests.post(f'{host}:{port.eContracting}/command2', json=payload).json() response.error['result'] = [{ 'code': 'RQ-1/9', 'description': "Error parsing 'params'" }] assert actualresult == response.error
import random import pytest import requests from pytest_testrail.plugin import pytestrail action_enum = ('validateRequirementResponse', ) @pytest.mark.parametrize("param, value, description", [ pytest.param( "version", "", "Data format mismatch. Expected data format: '00.00.00', actual value: ''.", marks=pytestrail.case("C14103"), id="version as empty string"), pytest.param( "id", "", "Data format mismatch. Expected data format: 'uuid', actual value: ''.", marks=pytestrail.case("C14104"), id="id as empty string") ]) def test_validateRequirementResponse_data_format_mismatch( port, host, response, param, request_template, value, description): payload = request_template() payload[param] = value actualresult = requests.post(f'{host}:{port.eDossier}/command2', json=payload).json() response.error['result'] = [{ "code": "DR-4/19",
amendmentId=str(amendment_id_2)) actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json() assert actualresult == response.success @pytest.mark.parametrize("param,value,code,description", [ pytest.param( "cpid", "", "DR-5/21", "Data mismatch of attribute 'cpid'" " to the pattern: '^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-[0-9]{13}$'." " Actual value: ''.", marks=pytestrail.case("C15040"), id="cpid as emptyString"), pytest.param("cpid", 22.9, "DR-5/21", "Data mismatch of attribute 'cpid' to the pattern: " "'^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-[0-9]{13}$'." " Actual value: '22.9'.", marks=pytestrail.case("C15041"), id="cpid as number"), pytest.param("cpid", True, "DR-5/21", "Data mismatch of attribute 'cpid' to the pattern: " "'^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-[0-9]{13}$'." " Actual value: 'true'.",
import random import pytest import requests from pytest_testrail.plugin import pytestrail action_enum = ('getAwardStateByIds', 'checkAccessToAward', 'checkRelatedTenderer', 'createRequirementResponse', 'createUnsuccessfulAwards', 'closeAwardPeriod') @pytest.mark.parametrize("param,value,code,description", [ pytest.param("version", 3.14, "DR-2/7", "Data type mismatch of attribute 'version'." " Expected data type: 'STRING', actual data type: 'NUMBER'.", marks=pytestrail.case('C12500'), id="version as number."), pytest.param("version", True, "DR-2/7", "Data type mismatch of attribute 'version'." " Expected data type: 'STRING', actual data type: 'BOOLEAN'.", marks=pytestrail.case("C12502"), id="version as boolean."), pytest.param("version", "", "DR-4/7", "Data format mismatch of attribute 'version'." " Expected data format: '00.00.00', actual value: ''.", marks=pytestrail.case("C12503"), id="version as empty str."), # pytest.param("version", None, "DR-2/21", # "Data type mismatch of attribute 'version'." # " Expected data type: 'not null', actual data type: 'null'.", # marks=pytestrail.case(), id="version as null."), # pytest.param("version", "99.0.a", "DR-4/21", # "Data format mismatch of attribute 'version'." # " Expected data format: '00.00.00', actual value: '99.0.a'.",
"code": "VR-10.4.1.1/7", "description": "Award not found.", "details": [{ "id": award_id_random }] }] assert actualresult == response.error @pytest.mark.parametrize( "param, value", [ pytest.param("cpid", "ocds-t1s2t3-MD-9999999999999", marks=pytestrail.case('C13244'), id="by cpid"), pytest.param("ocid", "ocds-t1s2t3-MD-9999999999999-EV-9999999999999", marks=pytestrail.case('C16300'), id="by ocid"), # None for array awardIds. pytest.param( None, None, marks=pytestrail.case('C13243'), id="by awardId") ]) def test_getAwardStateByIds_the_award_is_not_present_in_DB( port, host, param, value, data_award, prepared_entity_id, payload_getAwardStateByIds, response, prepared_owner, execute_insert_into_evaluation_award, prepared_cpid): execute_insert_into_evaluation_award(cp_id=prepared_cpid, stage='EV',
from uuid import uuid4 import pytest import requests from pytest_testrail.plugin import pytestrail @pytest.mark.parametrize('relatesTo', [ pytest.param('tender', marks=pytestrail.case('C8104')), pytest.param('lot', marks=pytestrail.case('C8378')) ]) def test_the_eRevision_return_amendment_ids_if_there_is_amendments_in_pending_cancellation_status_for_( port, host, relatesTo, execute_insert_into_revision_amendments, prepared_cpid, prepared_ev_ocid, prepared_entity_id, prepared_request_id, prepared_create_amendment, prepared_payload_findAmendmentIds, clear_revision_amendments_by_cpid, response): amendment_id = prepared_entity_id() prepared_create_amendment['id'] = f"{amendment_id}" prepared_create_amendment['relatesTo'] = relatesTo prepared_create_amendment['relatedItem'] = f"{prepared_ev_ocid}" execute_insert_into_revision_amendments(cpid=prepared_cpid, ocid=prepared_ev_ocid, id=amendment_id, data=prepared_create_amendment) payload = prepared_payload_findAmendmentIds(relatesTo=relatesTo) actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json() response.success['result'] = [f"{amendment_id}"] assert actualresult == response.success
"code": "VR.COM-1.9.1", "description": f"Tender not found by cpid '{cpid}' and ocid '{ocid}'." }] assert actualresult == response.error @pytest.mark.parametrize("param, value, description", [ pytest.param( "cpid", "ocds-t1s2t3MD9999999999999", "Data mismatch to pattern: '^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-[0-9]{13}$'. " "Actual value: 'ocds-t1s2t3MD9999999999999'.", marks=pytestrail.case('C17085'), id="by cpid"), pytest.param( "ocid", "ocds-t1s2t3-MD-9999999999999EV0000000000999", "Data mismatch to pattern: " "'^[a-z]{4}-[a-z0-9]{6}-[A-Z]{2}-[0-9]{13}-(AC|EI|EV|FS|NP|PN)-[0-9]{13}$'." " Actual value: 'ocds-t1s2t3-MD-9999999999999EV0000000000999'.", marks=pytestrail.case('C17092'), id="by ocid") ]) def test_getOrganization_data_mismatch_to_the_pattern(host, port, response, param, value, payload_getOrganization, description): payload = payload_getOrganization(role="procuringEntity")
import random from datetime import datetime import pytest import requests from pytest_testrail.plugin import pytestrail @pytest.mark.parametrize("states,status,statusDetails", [ pytest.param({"status": "complete"}, "complete", random.choice(("unsuccessful", "awarded", "cancelled", "empty")), marks=pytestrail.case('C8020')), pytest.param({"status": "active"}, "active", random.choice(("unsuccessful", "awarded", "cancelled", "empty")), marks=pytestrail.case('C8025')), pytest.param({"status": "unsuccessful"}, "unsuccessful", random.choice(("unsuccessful", "awarded", "cancelled", "empty")), marks=pytestrail.case('C8026')), pytest.param({"status": "cancelled"}, "cancelled", random.choice(("unsuccessful", "awarded", "cancelled", "empty")), marks=pytestrail.case('C8027')), pytest.param({"status": "planning"}, "planning", random.choice(("unsuccessful", "awarded", "cancelled", "empty")), marks=pytestrail.case('C8028')), pytest.param({"statusDetails": "empty"}, "active", "empty",
import pytest import requests from pytest_testrail.plugin import pytestrail action_enum = ("checkRegistration", "openAccess") @pytest.mark.parametrize( "param,value,code,description", [ pytest.param( "version", 3.14, "DR-2/14", "Data type mismatch." " Expected data type: 'STRING', actual data type: 'NUMBER'.", marks=pytestrail.case('C8629'), id="version as number."), # pytest.param("version", True, "DR-2/14", # "Data type mismatch." # " Expected data type: 'STRING', actual data type: 'BOOLEAN'.", # marks=pytestrail.case(), id="version as boolean."), pytest.param("version", "", "DR-4/14", "Data format mismatch." " Expected data format: '00.00.00', actual value: ''.", marks=pytestrail.case('C8628'), id="version as empty str."), pytest.param( "version", None, "DR-2/14", "Data type mismatch."
import json import uuid import pytest import pytest_check as check import requests from pytest_testrail.plugin import pytestrail @pytest.mark.parametrize("param,value,operationType", [ pytest.param("status", "pending", "tenderCancellation", marks=pytestrail.case('C8201')), pytest.param("type", "cancellation", "tenderCancellation", marks=pytestrail.case('C8339')), pytest.param("relatesTo", "tender", "tenderCancellation", marks=pytestrail.case('C8340')), pytest.param("relatesTo", "lot", "lotCancellation", marks=pytestrail.case('C8341')) ]) def test_on_eRevision_is_assign_pending_value_for_result_status(port, host, param, value, operationType, prepared_entity_id, prepared_payload_createAmendment): related_entity_id = prepared_entity_id() payload = prepared_payload_createAmendment(amendment_id=related_entity_id) payload['params']['operationType'] = operationType payload['params']['relatedEntityId'] = f"{related_entity_id}" actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json() assert actualresult['result'][param] == value @pytest.mark.parametrize("operationType", [
owner=prepared_owner) payload = payload_getTenderState() actualresult = requests.post(f'{host}:{port.eAccess}/command2', json=payload).json() response.success['result'] = { "status": "active", "statusDetails": "clarification" } assert actualresult == response.success @pytest.mark.parametrize("param, value", [ pytest.param("cpid", "ocds-t1s2t3-MD-0000000000000", marks=pytestrail.case('C16560'), id="by cpid"), pytest.param("ocid", "ocds-t1s2t3-MD-0000000000000-AC-0000000000000", marks=pytestrail.case('C16561'), id="by ocid"), ]) def test_getTenderState_tender_not_found(port, host, param, value, data_tender, execute_insert_into_access_tender, payload_getTenderState, prepared_cpid, prepared_owner, prepared_token_entity, response): execute_insert_into_access_tender(cp_id=prepared_cpid, stage='EV', token_entity=prepared_token_entity, created_date=datetime.now(),
'code': 'DR-4/21', 'description': "Data format mismatch of attribute 'amendmentIds'." " Expected data format: 'uuid'," f" actual value: '{amendment_id}'.", 'details': [{ 'name': 'amendmentIds' }] }] assert actualresult == response.error @pytest.mark.parametrize("param", [ pytest.param("cpid", marks=pytestrail.case('C17062')), pytest.param("ocid", marks=pytestrail.case('C17063')), pytest.param("amendmentIds", marks=pytestrail.case('C17064')) ]) def test_getAmendmentByIds_without_required_param(port, host, param, payload_getAmendmentByIds, response): payload = payload_getAmendmentByIds() del payload['params'][param] actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json() response.error['result'] = [{ "code": "RQ-1/21", "description": "Error parsing 'params'" }]
from datetime import datetime import pytest import requests from pytest_testrail.plugin import pytestrail @pytest.mark.parametrize("status,statusDetails", [ pytest.param("complete", "empty", marks=pytestrail.case('C8345')), pytest.param("active", "empty", marks=pytestrail.case('C8346')), pytest.param("unsuccessful", "empty", marks=pytestrail.case('C8347')), pytest.param("cancelled", "empty", marks=pytestrail.case('C8348')), pytest.param("planning", "empty", marks=pytestrail.case('C8349')), pytest.param("active", "awarded", marks=pytestrail.case('C8350')), ]) def test_eAccess_returns_successful_response_with_lot_state( host, port, status, statusDetails, data_tender, prepared_cpid, prepared_token_entity, prepared_owner, payload_getLotStateByIds, execute_insert_into_access_tender, response, prepared_entity_id, clear_access_tender_by_cpid): lot_id = str(prepared_entity_id()) data = data_tender data['tender']['lots'][0]['id'] = lot_id data['tender']['lots'][0]['status'] = status data['tender']['lots'][0]['statusDetails'] = statusDetails execute_insert_into_access_tender(cp_id=prepared_cpid, stage='EV', token_entity=prepared_token_entity, created_date=datetime.now(), json_data=data, owner=prepared_owner)
import pytest import requests from pytest_testrail.plugin import pytestrail @pytest.mark.parametrize("operationType", [ pytest.param("tenderCancellation", marks=pytestrail.case('C8111')), pytest.param("lotCancellation", marks=pytestrail.case('C8112')) ]) def test_on_dataValidation_with_a_valid_data(host, port, operationType, response, prepared_payload_dataValidation): payload = prepared_payload_dataValidation() payload['params']['operationType'] = operationType actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json() assert actualresult == response.success @pytest.mark.parametrize("param", [ pytest.param("amendment", marks=pytestrail.case('C8117')), pytest.param("cpid", marks=pytestrail.case('C8126')), pytest.param("ocid", marks=pytestrail.case('C8127')), pytest.param("operationType", marks=pytestrail.case('C8128')) ]) def test_on_dataValidation_without_param_in_params(host, port, param, prepared_request_id, prepared_payload_dataValidation, response): payload = prepared_payload_dataValidation() del payload['params'][param] actualresult = requests.post(f'{host}:{port.eRevision}/command', json=payload).json()
record = execute_select_access_tenders_by_cpid(cp_id=cpid).one() json_data = json.loads(record.json_data) assert json_data['tender']['lots'][0]['id'] == data['tender']['lots'][0][ 'id'] assert json_data['tender']['lots'][0]['status'] == data['tender']['lots'][ 0]['status'] assert json_data['tender']['lots'][0]['statusDetails'] == data['tender'][ 'lots'][0]['statusDetails'] @pytest.mark.parametrize("record_status, set_status", [ pytest.param("active", "cancelled", marks=pytestrail.case('C17131'), id=" status as cancelled"), pytest.param("cancelled", "active", marks=pytestrail.case('C17132'), id=" status as active"), pytest.param("active", "complete", marks=pytestrail.case('C17133'), id=" status as complete"), ]) def test_setStateForLots_set_the_status(host, port, record_status, set_status, prepared_cpid, response, prepared_token_entity, prepared_owner, prepare_data, payload_setStateForLots, execute_insert_into_access_tender,