VOL-2642 Add a Makefile, tests, and virtualenv
Convert common python and robot into a CORDRobot python module that can
be installed via standard python tools (pip) and from PyPI
Uses a fork of https://github.com/rasjani/robotframework-importresource,
which has been backported to Python 3.5 (used in Ubuntu 16.04
executors).
Reformatted and moved keywords so resource files are scoped to a
specific topic.
Added tox tests for library consistency
- flake8
- pylint
- robotframework-lint
- Ran robot against installed library to verify it can be loaded and
used
Added basic lint and tests to whole repo
Removed old tests:
- CORD <6.x era: SanityPhyPOD.robot, and onosUtils.py
Change-Id: I61265a9fb04034a086e20be1f7236a8793a218aa
diff --git a/src/test/cord-api/Tests/Ch_SliceTest.txt b/src/test/cord-api/Tests/Ch_SliceTest.txt
index 4299da1..f8218ac 100644
--- a/src/test/cord-api/Tests/Ch_SliceTest.txt
+++ b/src/test/cord-api/Tests/Ch_SliceTest.txt
@@ -7,8 +7,8 @@
Library OperatingSystem
Library XML
Library RequestsLibrary
-Library ../Framework/utils/utils.py
-Library ../Framework/restApi.py
+Library CORDRobot
+Library ImportResource resources=CORDRobot
Variables ../Properties/RestApiProperties.py
*** Variables ***
@@ -26,7 +26,7 @@
*** Keywords ***
Read InputFile
- ${sliceList} = utils.jsonToList ${PATHFILE} SliceInfo
+ ${sliceList} = CORDRobot.jsonToList ${PATHFILE} SliceInfo
Set Suite Variable ${sList} ${sliceList}
Verify Slice API functionality
@@ -38,33 +38,33 @@
Test Post Slice API
[Arguments] ${listIndex}
${sliceList} = Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
- ${api_result}= restApi.ApiPost CH_CORE_SLICES ${sliceDict}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
+ ${api_result}= CORDRobot.ApiPost CH_CORE_SLICES ${sliceDict}
Should Be True ${api_result}
Test Get Slice API
[Arguments] ${listIndex}
- ${json_result}= restApi.ApiGet CH_CORE_SLICES
+ ${json_result}= CORDRobot.ApiGet CH_CORE_SLICES
${json_result_list}= Get From Dictionary ${json_result} items
Log ${json_result_list}
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sliceList} ${listIndex}
+ ${sliceDict}= CORDRobot.listToDict ${sliceList} ${listIndex}
${sliceName}= Get From Dictionary ${sliceDict} name
- ${getJsonDict}= utils.getDictFromListOfDict ${json_result_list} name ${sliceName}
- ${test_result}= utils.compare_dict ${sliceDict} ${getJsonDict}
+ ${getJsonDict}= CORDRobot.getDictFromListOfDict ${json_result_list} name ${sliceName}
+ ${test_result}= CORDRobot.compare_dict ${sliceDict} ${getJsonDict}
Should Be True ${json_result}
Test Delete Slice API
[Arguments] ${listIndex}
- ${json_getresult}= restApi.ApiGet CH_CORE_SLICES
+ ${json_getresult}= CORDRobot.ApiGet CH_CORE_SLICES
${json_getresult_list}= Get From Dictionary ${json_getresult} items
${sliceList}= Get Variable Value ${sList}
- ${sliceDict}= utils.listToDict ${sList} ${listIndex}
- ${sliceName}= utils.getFieldValueFromDict ${sliceDict} name
+ ${sliceDict}= CORDRobot.listToDict ${sList} ${listIndex}
+ ${sliceName}= CORDRobot.getFieldValueFromDict ${sliceDict} name
Log ${sliceName}
- ${getSliceDict}= utils.getDictFromListofDict ${json_getresult_list} name ${sliceName}
+ ${getSliceDict}= CORDRobot.getDictFromListofDict ${json_getresult_list} name ${sliceName}
Log ${getSliceDict}
- ${sliceID}= utils.getFieldValueFromDict ${getSliceDict} id
+ ${sliceID}= CORDRobot.getFieldValueFromDict ${getSliceDict} id
Log ${sliceID}
- ${test_result}= restApi.ApiChameleonDelete CH_CORE_SLICES ${sliceID}
+ ${test_result}= CORDRobot.ApiChameleonDelete CH_CORE_SLICES ${sliceID}
Should be True ${test_result}