Commit f79dac4e87ad5dcebd1a03f935f4d04f6cab2b2b
Merge pull request #696 from OrysiaDrabych/moz
Add tests for integration with MOZ
Showing
9 changed files
with
253 additions
and
17 deletions
@@ -17,6 +17,7 @@ Resource resource.robot | @@ -17,6 +17,7 @@ Resource resource.robot | ||
17 | ... lot_meat=${${LOT_MEAT}} | 17 | ... lot_meat=${${LOT_MEAT}} |
18 | ... item_meat=${${ITEM_MEAT}} | 18 | ... item_meat=${${ITEM_MEAT}} |
19 | ... api_host_url=${API_HOST_URL} | 19 | ... api_host_url=${API_HOST_URL} |
20 | + ... moz_integration=${${MOZ_INTEGRATION}} | ||
20 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | 21 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} |
21 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | 22 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} |
22 | ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} | 23 | ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} |
@@ -150,7 +150,10 @@ def test_tender_data(params, | @@ -150,7 +150,10 @@ def test_tender_data(params, | ||
150 | inc_dt += timedelta(minutes=params['intervals'][period_name][i]) | 150 | inc_dt += timedelta(minutes=params['intervals'][period_name][i]) |
151 | period_dict[period_name + "Period"][j + "Date"] = inc_dt.astimezone(TZ).isoformat() | 151 | period_dict[period_name + "Period"][j + "Date"] = inc_dt.astimezone(TZ).isoformat() |
152 | data.update(period_dict) | 152 | data.update(period_dict) |
153 | - cpv_group = fake.cpv()[:4] | 153 | + if params.get('moz_integration'): |
154 | + cpv_group = 336 | ||
155 | + else: | ||
156 | + cpv_group = fake.cpv()[:4] | ||
154 | if params.get('number_of_lots'): | 157 | if params.get('number_of_lots'): |
155 | data['lots'] = [] | 158 | data['lots'] = [] |
156 | for lot_number in range(params['number_of_lots']): | 159 | for lot_number in range(params['number_of_lots']): |
@@ -235,7 +235,8 @@ Get Broker Property By Username | @@ -235,7 +235,8 @@ Get Broker Property By Username | ||
235 | 235 | ||
236 | Підготувати дані для створення предмету закупівлі | 236 | Підготувати дані для створення предмету закупівлі |
237 | [Arguments] ${cpv} | 237 | [Arguments] ${cpv} |
238 | - ${item}= test_item_data ${cpv[0:4]} | 238 | + ${index}= Set variable if ${moz_integration} 3 4 |
239 | + ${item}= test_item_data ${cpv[:${index}]} | ||
239 | [Return] ${item} | 240 | [Return] ${item} |
240 | 241 | ||
241 | 242 |
@@ -11,8 +11,9 @@ ${MODE} negotiation.quick | @@ -11,8 +11,9 @@ ${MODE} negotiation.quick | ||
11 | ${NUMBER_OF_ITEMS} ${2} | 11 | ${NUMBER_OF_ITEMS} ${2} |
12 | ${NUMBER_OF_LOTS} ${0} | 12 | ${NUMBER_OF_LOTS} ${0} |
13 | ${TENDER_MEAT} ${False} | 13 | ${TENDER_MEAT} ${False} |
14 | -${LOT_MEAT} ${False} | ||
15 | -${ITEM_MEAT} ${False} | 14 | +${LOT_MEAT} ${False} |
15 | +${ITEM_MEAT} ${False} | ||
16 | +${MOZ_INTEGRATION} ${False} | ||
16 | 17 | ||
17 | *** Test Cases *** | 18 | *** Test Cases *** |
18 | ############################################################################################## | 19 | ############################################################################################## |
@@ -11,8 +11,9 @@ ${MODE} negotiation | @@ -11,8 +11,9 @@ ${MODE} negotiation | ||
11 | ${NUMBER_OF_ITEMS} ${2} | 11 | ${NUMBER_OF_ITEMS} ${2} |
12 | ${NUMBER_OF_LOTS} ${0} | 12 | ${NUMBER_OF_LOTS} ${0} |
13 | ${TENDER_MEAT} ${False} | 13 | ${TENDER_MEAT} ${False} |
14 | -${LOT_MEAT} ${False} | ||
15 | -${ITEM_MEAT} ${False} | 14 | +${LOT_MEAT} ${False} |
15 | +${ITEM_MEAT} ${False} | ||
16 | +${MOZ_INTEGRATION} ${False} | ||
16 | 17 | ||
17 | *** Test Cases *** | 18 | *** Test Cases *** |
18 | ############################################################################################## | 19 | ############################################################################################## |
@@ -101,8 +101,15 @@ class OP_Provider(BaseProvider): | @@ -101,8 +101,15 @@ class OP_Provider(BaseProvider): | ||
101 | return self.random_element(self.funders_scheme_list) | 101 | return self.random_element(self.funders_scheme_list) |
102 | 102 | ||
103 | @classmethod | 103 | @classmethod |
104 | - def cpv(self): | ||
105 | - return self.random_element(self.cpvs) | 104 | + def cpv(self, cpv_group=None): |
105 | + if cpv_group: | ||
106 | + cpvs = [] | ||
107 | + for cpv_element in self.cpvs: | ||
108 | + if cpv_element.startswith(cpv_group): | ||
109 | + cpvs.append(cpv_element) | ||
110 | + return self.random_element(cpvs) | ||
111 | + else: | ||
112 | + return self.random_element(self.cpvs) | ||
106 | 113 | ||
107 | @classmethod | 114 | @classmethod |
108 | def fake_item(self, cpv_group=None): | 115 | def fake_item(self, cpv_group=None): |
@@ -113,6 +120,7 @@ class OP_Provider(BaseProvider): | @@ -113,6 +120,7 @@ class OP_Provider(BaseProvider): | ||
113 | from a specific cpv group. Cpv group is three digits | 120 | from a specific cpv group. Cpv group is three digits |
114 | in the beginning of each cpv id. | 121 | in the beginning of each cpv id. |
115 | """ | 122 | """ |
123 | + item_base_data = None | ||
116 | if cpv_group is None: | 124 | if cpv_group is None: |
117 | item_base_data = self.random_element(self.items_base_data) | 125 | item_base_data = self.random_element(self.items_base_data) |
118 | else: | 126 | else: |
@@ -126,12 +134,16 @@ class OP_Provider(BaseProvider): | @@ -126,12 +134,16 @@ class OP_Provider(BaseProvider): | ||
126 | if entity["cpv_id"] == cpv: | 134 | if entity["cpv_id"] == cpv: |
127 | item_base_data = entity | 135 | item_base_data = entity |
128 | break | 136 | break |
137 | + if not item_base_data: | ||
138 | + raise ValueError('unable to find an item with CPV ' + cpv) | ||
129 | 139 | ||
130 | # choose appropriate additional classification for item_base_data's cpv | 140 | # choose appropriate additional classification for item_base_data's cpv |
131 | additional_class = [] | 141 | additional_class = [] |
132 | for entity in self.classifications: | 142 | for entity in self.classifications: |
133 | if entity["classification"]["id"] == item_base_data["cpv_id"]: | 143 | if entity["classification"]["id"] == item_base_data["cpv_id"]: |
134 | additional_class.append(entity) | 144 | additional_class.append(entity) |
145 | + if not additional_class: | ||
146 | + raise ValueError('unable to find a matching additional classification for CPV ' + cpv) | ||
135 | classification = self.random_element(additional_class) | 147 | classification = self.random_element(additional_class) |
136 | 148 | ||
137 | dk_descriptions = { | 149 | dk_descriptions = { |
@@ -141,6 +153,7 @@ class OP_Provider(BaseProvider): | @@ -141,6 +153,7 @@ class OP_Provider(BaseProvider): | ||
141 | } | 153 | } |
142 | address = self.random_element(self.addresses) | 154 | address = self.random_element(self.addresses) |
143 | item = { | 155 | item = { |
156 | + "additionalClassifications": classification["additionalClassifications"], | ||
144 | "classification": classification["classification"], | 157 | "classification": classification["classification"], |
145 | "deliveryAddress": address["deliveryAddress"], | 158 | "deliveryAddress": address["deliveryAddress"], |
146 | "deliveryLocation": address["deliveryLocation"], | 159 | "deliveryLocation": address["deliveryLocation"], |
@@ -150,7 +163,6 @@ class OP_Provider(BaseProvider): | @@ -150,7 +163,6 @@ class OP_Provider(BaseProvider): | ||
150 | if item_base_data["cpv_id"] == "99999999-9": | 163 | if item_base_data["cpv_id"] == "99999999-9": |
151 | scheme = classification["additionalClassifications"][0]["scheme"] | 164 | scheme = classification["additionalClassifications"][0]["scheme"] |
152 | item.update({ | 165 | item.update({ |
153 | - "additionalClassifications": classification["additionalClassifications"], | ||
154 | "description": dk_descriptions[scheme][0], | 166 | "description": dk_descriptions[scheme][0], |
155 | "description_ru": dk_descriptions[scheme][1], | 167 | "description_ru": dk_descriptions[scheme][1], |
156 | "description_en": dk_descriptions[scheme][2] | 168 | "description_en": dk_descriptions[scheme][2] |
@@ -7557,6 +7557,146 @@ | @@ -7557,6 +7557,146 @@ | ||
7557 | "id": "22993000-7", | 7557 | "id": "22993000-7", |
7558 | "description": "Фоточутливі, термочутливі та термографічні папір та картон" | 7558 | "description": "Фоточутливі, термочутливі та термографічні папір та картон" |
7559 | } | 7559 | } |
7560 | + }, | ||
7561 | + { | ||
7562 | + "additionalClassifications": [ | ||
7563 | + { | ||
7564 | + "scheme": "INN", | ||
7565 | + "description": "Ibuprofen", | ||
7566 | + "id": "ibuprofen" | ||
7567 | + }, | ||
7568 | + { | ||
7569 | + "scheme": "ATC", | ||
7570 | + "description": "ibuprofen", | ||
7571 | + "id": "M01AE01" | ||
7572 | + } | ||
7573 | + | ||
7574 | + ], | ||
7575 | + "classification": { | ||
7576 | + "scheme": "ДК021", | ||
7577 | + "id": "33632100-0", | ||
7578 | + "description": "Протизапальні та протиревматичні засоби" | ||
7579 | + } | ||
7580 | + }, | ||
7581 | + { | ||
7582 | + "additionalClassifications": [ | ||
7583 | + { | ||
7584 | + "scheme": "INN", | ||
7585 | + "description": "Clonidine", | ||
7586 | + "id": "clonidine" | ||
7587 | + }, | ||
7588 | + { | ||
7589 | + "scheme": "ATC", | ||
7590 | + "description": "clonidine", | ||
7591 | + "id": "C02AC01" | ||
7592 | + } | ||
7593 | + | ||
7594 | + ], | ||
7595 | + "classification": { | ||
7596 | + "scheme": "ДК021", | ||
7597 | + "id": "33622200-8", | ||
7598 | + "description": "Протигіпертонічні засоби" | ||
7599 | + } | ||
7600 | + }, | ||
7601 | + { | ||
7602 | + "additionalClassifications": [ | ||
7603 | + { | ||
7604 | + "scheme": "INN", | ||
7605 | + "description": "Insulin (human)", | ||
7606 | + "id": "insulin (human)" | ||
7607 | + }, | ||
7608 | + { | ||
7609 | + "scheme": "ATC", | ||
7610 | + "description": "insulin (human)", | ||
7611 | + "id": "A10AB01" | ||
7612 | + } | ||
7613 | + | ||
7614 | + ], | ||
7615 | + "classification": { | ||
7616 | + "scheme": "ДК021", | ||
7617 | + "id": "33615100-5", | ||
7618 | + "description": "Інсулін" | ||
7619 | + } | ||
7620 | + }, | ||
7621 | + { | ||
7622 | + "additionalClassifications": [ | ||
7623 | + { | ||
7624 | + "scheme": "INN", | ||
7625 | + "description": "Lactulose", | ||
7626 | + "id": "lactulose" | ||
7627 | + }, | ||
7628 | + { | ||
7629 | + "scheme": "ATC", | ||
7630 | + "description": "lactulose", | ||
7631 | + "id": "A06AD11" | ||
7632 | + } | ||
7633 | + | ||
7634 | + ], | ||
7635 | + "classification": { | ||
7636 | + "scheme": "ДК021", | ||
7637 | + "id": "33612000-3", | ||
7638 | + "description": "Лікарські засоби для лікування функціональних розладів шлунково-кишкового тракту" | ||
7639 | + } | ||
7640 | + }, | ||
7641 | + { | ||
7642 | + "additionalClassifications": [ | ||
7643 | + { | ||
7644 | + "scheme": "INN", | ||
7645 | + "description": "Piracetam", | ||
7646 | + "id": "piracetam" | ||
7647 | + }, | ||
7648 | + { | ||
7649 | + "scheme": "ATC", | ||
7650 | + "description": "piracetam", | ||
7651 | + "id": "N06BX03" | ||
7652 | + } | ||
7653 | + | ||
7654 | + ], | ||
7655 | + "classification": { | ||
7656 | + "scheme": "ДК021", | ||
7657 | + "id": "33692500-2", | ||
7658 | + "description": "Розчини для ін’єкцій" | ||
7659 | + } | ||
7660 | + }, | ||
7661 | + { | ||
7662 | + "additionalClassifications": [ | ||
7663 | + { | ||
7664 | + "scheme": "INN", | ||
7665 | + "description": "Atracurium", | ||
7666 | + "id": "atracurium" | ||
7667 | + }, | ||
7668 | + { | ||
7669 | + "scheme": "ATC", | ||
7670 | + "description": "atracurium", | ||
7671 | + "id": "M03AC04" | ||
7672 | + } | ||
7673 | + | ||
7674 | + ], | ||
7675 | + "classification": { | ||
7676 | + "scheme": "ДК021", | ||
7677 | + "id": "33692500-2", | ||
7678 | + "description": "Розчини для ін’єкцій" | ||
7679 | + } | ||
7680 | + }, | ||
7681 | + { | ||
7682 | + "additionalClassifications": [ | ||
7683 | + { | ||
7684 | + "scheme": "INN", | ||
7685 | + "description": "Moxifloxacin", | ||
7686 | + "id": "moxifloxacin" | ||
7687 | + }, | ||
7688 | + { | ||
7689 | + "scheme": "ATC", | ||
7690 | + "description": "moxifloxacin", | ||
7691 | + "id": "S01AE07" | ||
7692 | + } | ||
7693 | + | ||
7694 | + ], | ||
7695 | + "classification": { | ||
7696 | + "scheme": "ДК021", | ||
7697 | + "id": "33692100-8", | ||
7698 | + "description": "Інфузійні розчини" | ||
7699 | + } | ||
7560 | } | 7700 | } |
7561 | ], | 7701 | ], |
7562 | "units": [ | 7702 | "units": [ |
@@ -7639,18 +7779,28 @@ | @@ -7639,18 +7779,28 @@ | ||
7639 | { | 7779 | { |
7640 | "code": "D64", | 7780 | "code": "D64", |
7641 | "name": "блок" | 7781 | "name": "блок" |
7782 | + }, | ||
7783 | + { | ||
7784 | + "code": "VI", | ||
7785 | + "name": "флакон" | ||
7642 | } | 7786 | } |
7643 | ], | 7787 | ], |
7644 | "cpvs": [ | 7788 | "cpvs": [ |
7645 | - "30199000-0", | ||
7646 | - "24910000-6", | ||
7647 | - "22990000-6", | 7789 | + "22200000-2", |
7790 | + "22212000-9", | ||
7648 | "22800000-8", | 7791 | "22800000-8", |
7792 | + "22990000-6", | ||
7793 | + "24910000-6", | ||
7649 | "30192121-5", | 7794 | "30192121-5", |
7650 | "30192130-1", | 7795 | "30192130-1", |
7651 | "30197600-2", | 7796 | "30197600-2", |
7652 | - "22200000-2", | ||
7653 | - "22212000-9", | 7797 | + "30199000-0", |
7798 | + "33615100-5", | ||
7799 | + "33622200-8", | ||
7800 | + "33632100-0", | ||
7801 | + "33612000-3", | ||
7802 | + "33692500-2", | ||
7803 | + "33692100-8", | ||
7654 | "99999999-9" | 7804 | "99999999-9" |
7655 | ], | 7805 | ], |
7656 | "items_base_data": [ | 7806 | "items_base_data": [ |
@@ -7763,6 +7913,72 @@ | @@ -7763,6 +7913,72 @@ | ||
7763 | "code": "SET", | 7913 | "code": "SET", |
7764 | "name": "набір" | 7914 | "name": "набір" |
7765 | } | 7915 | } |
7916 | + }, | ||
7917 | + { | ||
7918 | + "cpv_id": "33632100-0", | ||
7919 | + "description": "Протизапальний та протиревматичний засіб Ібупрофен", | ||
7920 | + "description_ru": "Противовоспалительное и противоревматическое средство Ибупрофен", | ||
7921 | + "description_en": "Anti-inflammatory and antirheumatic agent Ibuprofen", | ||
7922 | + "quantity": 15, | ||
7923 | + "unit": { | ||
7924 | + "code": "PK", | ||
7925 | + "name": "упаковка" | ||
7926 | + } | ||
7927 | + }, | ||
7928 | + { | ||
7929 | + "cpv_id": "33622200-8", | ||
7930 | + "description": "Протигіпертонічний засіб Клонідін", | ||
7931 | + "description_ru": "Противогипертонические средство Клонидин", | ||
7932 | + "description_en": "Antihypertensive agent Clonidine", | ||
7933 | + "quantity": 15, | ||
7934 | + "unit": { | ||
7935 | + "code": "PK", | ||
7936 | + "name": "упаковка" | ||
7937 | + } | ||
7938 | + }, | ||
7939 | + { | ||
7940 | + "cpv_id": "33615100-5", | ||
7941 | + "description": "Інсулін людський генно-інженерний короткої дії у флаконах 5 мл (500 Од у флаконі) № 5", | ||
7942 | + "description_ru": "Инсулин человеческий генно-инженерный краткосрочного действия у флаконах 5 мл (500 Од в флаконе) № 5", | ||
7943 | + "description_en": "Insulin human genetically-engineered short-acting in vials of 5 ml (500 IU vial) No. 5", | ||
7944 | + "quantity": 15, | ||
7945 | + "unit": { | ||
7946 | + "code": "VI", | ||
7947 | + "name": "флакон" | ||
7948 | + } | ||
7949 | + }, | ||
7950 | + { | ||
7951 | + "cpv_id": "33612000-3", | ||
7952 | + "description": "Засіб для лікування функціональних розладів шлунково-кишкового тракту Лактулоза", | ||
7953 | + "description_ru": "Средство для лечения функциональных расстройств желудочно-кишечного тракта Лактулоза", | ||
7954 | + "description_en": "Agent for functional gastrointestinal disorders treatment Lactulose", | ||
7955 | + "quantity": 15, | ||
7956 | + "unit": { | ||
7957 | + "code": "PK", | ||
7958 | + "name": "упаковка" | ||
7959 | + } | ||
7960 | + }, | ||
7961 | + { | ||
7962 | + "cpv_id": "33692500-2", | ||
7963 | + "description": "Розчин для ін’єкцій", | ||
7964 | + "description_ru": "Раствор для инъекций", | ||
7965 | + "description_en": "Injectable solution", | ||
7966 | + "quantity": 15, | ||
7967 | + "unit": { | ||
7968 | + "code": "VI", | ||
7969 | + "name": "флакон" | ||
7970 | + } | ||
7971 | + }, | ||
7972 | + { | ||
7973 | + "cpv_id": "33692100-8", | ||
7974 | + "description": "АВЕЛОКС розчин для інфузій 400 мг/250 мл 250 мл флакони № 1", | ||
7975 | + "description_ru": "Авелокс раствор для инфузий 400 мг / 250 мл 250 мл флаконы № 1", | ||
7976 | + "description_en": "AVELLOX solution for infusion 400 mg / 250 ml 250 ml bottle № 1", | ||
7977 | + "quantity": 15, | ||
7978 | + "unit": { | ||
7979 | + "code": "VI", | ||
7980 | + "name": "флакон" | ||
7981 | + } | ||
7766 | } | 7982 | } |
7767 | ], | 7983 | ], |
7768 | "rationale_types": [ | 7984 | "rationale_types": [ |
@@ -15,7 +15,7 @@ ${NUMBER_OF_LOTS} ${1} | @@ -15,7 +15,7 @@ ${NUMBER_OF_LOTS} ${1} | ||
15 | ${TENDER_MEAT} ${True} | 15 | ${TENDER_MEAT} ${True} |
16 | ${LOT_MEAT} ${True} | 16 | ${LOT_MEAT} ${True} |
17 | ${ITEM_MEAT} ${True} | 17 | ${ITEM_MEAT} ${True} |
18 | - | 18 | +${MOZ_INTEGRATION} ${False} |
19 | 19 | ||
20 | *** Test Cases *** | 20 | *** Test Cases *** |
21 | Можливість оголосити тендер | 21 | Можливість оголосити тендер |
@@ -11,8 +11,9 @@ ${MODE} reporting | @@ -11,8 +11,9 @@ ${MODE} reporting | ||
11 | ${NUMBER_OF_ITEMS} ${2} | 11 | ${NUMBER_OF_ITEMS} ${2} |
12 | ${NUMBER_OF_LOTS} ${0} | 12 | ${NUMBER_OF_LOTS} ${0} |
13 | ${TENDER_MEAT} ${False} | 13 | ${TENDER_MEAT} ${False} |
14 | -${LOT_MEAT} ${False} | ||
15 | -${ITEM_MEAT} ${False} | 14 | +${LOT_MEAT} ${False} |
15 | +${ITEM_MEAT} ${False} | ||
16 | +${MOZ_INTEGRATION} ${False} | ||
16 | 17 | ||
17 | *** Test Cases *** | 18 | *** Test Cases *** |
18 | ############################################################################################## | 19 | ############################################################################################## |
Please
register
or
login
to post a comment