Commit 8cf54fa83d4846a2d16523d7c441bbe7aeac2676

Authored by selurvedu
1 parent e91ed50c

Import robot_tests.broker.* using sys.path

`Import Library` and `Import Resource` support searching in sys.path,
so we don't need to keep a hard-coded relative path for `external_st`
anymore. We still need to keep it for `bundled_st` though.
@@ -15,6 +15,14 @@ eggs = @@ -15,6 +15,14 @@ eggs =
15 openprocurement_client 15 openprocurement_client
16 robotframework-lint 16 robotframework-lint
17 robotframework-debuglibrary 17 robotframework-debuglibrary
  18 + robot_tests.broker.dzo
  19 + robot_tests.broker.etender
  20 + robot_tests.broker.newtend
  21 + robot_tests.broker.privatmarket
  22 + robot_tests.broker.prom
  23 + robot_tests.broker.publicbid
  24 + robot_tests.broker.publicportal
  25 + robot_tests.broker.smarttender
18 26
19 interpreter = python_interpreter 27 interpreter = python_interpreter
20 # The following piece of code changes the default output format of Munch 28 # The following piece of code changes the default output format of Munch
@@ -145,7 +145,6 @@ Get Broker Property By Username @@ -145,7 +145,6 @@ Get Broker Property By Username
145 [Return] ${claim} 145 [Return] ${claim}
146 146
147 147
148 -  
149 Підготовка даних для подання скарги 148 Підготовка даних для подання скарги
150 [Arguments] ${lot}=${False} 149 [Arguments] ${lot}=${False}
151 ${complaint}= test_complaint_data ${lot} 150 ${complaint}= test_complaint_data ${lot}
@@ -187,8 +186,22 @@ Get Broker Property By Username @@ -187,8 +186,22 @@ Get Broker Property By Username
187 186
188 187
189 Завантажуємо бібліотеку з реалізацією для майданчика ${keywords_file} 188 Завантажуємо бібліотеку з реалізацією для майданчика ${keywords_file}
  189 + [Documentation]
  190 + ... Load broker's driver (keyword library).
  191 + ...
  192 + ... `Import Resource` is called twice:
  193 + ...
  194 + ... 1) It tries to read from ``brokers/`` directory
  195 + ... (located next to ``keywords.robot``).
  196 + ... This is an old feature which will be removed in the future.
  197 + ...
  198 + ... 2) It looks for a given filename in ``sys.path``
  199 + ... (``PYTHONPATH`` environment variable).
  200 + ...
  201 + ... This keyword will fail if ``keywords_file`` was found
  202 + ... in both locations.
190 ${bundled_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}brokers${/}${keywords_file}.robot 203 ${bundled_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}brokers${/}${keywords_file}.robot
191 - ${external_st}= Run Keyword And Return Status Import Resource ${CURDIR}${/}..${/}..${/}src${/}robot_tests.broker.${keywords_file}${/}${keywords_file}.robot 204 + ${external_st}= Run Keyword And Return Status Import Resource ${keywords_file}.robot
192 Run Keyword If ${bundled_st} == ${external_st} == ${False} Fail Resource file ${keywords_file}.robot not found 205 Run Keyword If ${bundled_st} == ${external_st} == ${False} Fail Resource file ${keywords_file}.robot not found
193 Run Keyword If ${bundled_st} == ${external_st} == ${True} Fail Resource file ${keywords_file}.robot found in both brokers${/} and src${/} 206 Run Keyword If ${bundled_st} == ${external_st} == ${True} Fail Resource file ${keywords_file}.robot found in both brokers${/} and src${/}
194 207
Please register or login to post a comment