From 9e271437a027cc557323996602d9d0aa95dffb4f Mon Sep 17 00:00:00 2001 From: Rafael Leira Date: Wed, 29 Jun 2022 10:24:52 +0200 Subject: [PATCH] Added empty controller test --- .../controllerSet/test00/_show_J.json | 19 +++++++++++++++++++ .../datatest/controllerSet/test00/device.json | 3 +++ .../datatest/controllerSet/test01/device.json | 7 ++++++- tests/datatest/storcliSet/.keep | 0 tests/test_controllers.py | 3 ++- 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/datatest/controllerSet/test00/_show_J.json create mode 100644 tests/datatest/controllerSet/test00/device.json delete mode 100644 tests/datatest/storcliSet/.keep diff --git a/tests/datatest/controllerSet/test00/_show_J.json b/tests/datatest/controllerSet/test00/_show_J.json new file mode 100644 index 0000000..d887f7c --- /dev/null +++ b/tests/datatest/controllerSet/test00/_show_J.json @@ -0,0 +1,19 @@ +{ +"Controllers":[ +{ + "Command Status" : { + "CLI Version" : "007.1704.0000.0000 Jan 16, 2021", + "Operating system" : "Linux 5.18.5-200.fc36.x86_64", + "Status Code" : 0, + "Status" : "Success", + "Description" : "None" + }, + "Response Data" : { + "Number of Controllers" : 0, + "Host Name" : "jenova", + "Operating System " : "Linux 5.18.5-200.fc36.x86_64" + } +} +] +} + diff --git a/tests/datatest/controllerSet/test00/device.json b/tests/datatest/controllerSet/test00/device.json new file mode 100644 index 0000000..40ac5e6 --- /dev/null +++ b/tests/datatest/controllerSet/test00/device.json @@ -0,0 +1,3 @@ +{ + "Controller_ids": [] +} \ No newline at end of file diff --git a/tests/datatest/controllerSet/test01/device.json b/tests/datatest/controllerSet/test01/device.json index 9e26dfe..d4df2a9 100644 --- a/tests/datatest/controllerSet/test01/device.json +++ b/tests/datatest/controllerSet/test01/device.json @@ -1 +1,6 @@ -{} \ No newline at end of file +{ + "Controller_ids": [ + 0, + 1 + ] +} \ No newline at end of file diff --git a/tests/datatest/storcliSet/.keep b/tests/datatest/storcliSet/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_controllers.py b/tests/test_controllers.py index 11488b6..ab83282 100644 --- a/tests/test_controllers.py +++ b/tests/test_controllers.py @@ -32,4 +32,5 @@ def test_count_controllers(self, folder): # List controllers controllers = Controllers() - assert len(controllers.ids) > 0 + if "Controller_ids" in device_data: + assert controllers.ids == device_data["Controller_ids"]