stdlib,configs,tests: Remove deprecated Resource classes usage (#102)
* stdlib,configs,tests: Remove `Resource` class use This class is deprecated, but was still used in various example configuration scriots and tests. This patch replaces it with the `obtain_resource` function. Change-Id: I0c89bf17783ccaaafc18072aaeefb5d1e207bc55 * configs: Remove `CustomDiskImageResource` use The class is deprecated but was still used in the SPEC example scripts. This patch replaces it with the `DiskImageResource` class. Change-Id: Ie0697fe59a3d737b05eb45ff3bc964f42b0387e0 * configs,tests: Remove `CustomResource` use This class is deprecated but was still used in example scripts and mentioned, incorrectly, in comments in the pyunit tests. This patch removes these. Change-Id: Icb6d02f47a5b72cd58551e5dcd59cc72d6a91a01 * stdlib: Remove '\' in Workload docstring example This example shows how to use the Workload. The backslash is not correct Python and would fail if used in this way. Co-authored-by: Jason Lowe-Power <jason@lowepower.com> --------- Co-authored-by: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
@@ -72,14 +72,14 @@ class CustomWorkloadTestSuite(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_get_function_str(self) -> None:
|
||||
# Tests `CustomResource.get_function_str`
|
||||
# Tests `CustomWorkload.get_function_str`
|
||||
|
||||
self.assertEqual(
|
||||
"set_se_binary_workload", self.custom_workload.get_function_str()
|
||||
)
|
||||
|
||||
def test_get_parameters(self) -> None:
|
||||
# Tests `CustomResource.get_parameter`
|
||||
# Tests `CustomWorkload.get_parameter`
|
||||
|
||||
parameters = self.custom_workload.get_parameters()
|
||||
self.assertTrue(isinstance(parameters, Dict))
|
||||
@@ -95,7 +95,7 @@ class CustomWorkloadTestSuite(unittest.TestCase):
|
||||
self.assertEquals(6, parameters["arguments"][1])
|
||||
|
||||
def test_add_parameters(self) -> None:
|
||||
# Tests `CustomResource.set_parameter` for the case where we add a new
|
||||
# Tests `CustomWorkload.set_parameter` for the case where we add a new
|
||||
# parameter value.
|
||||
|
||||
self.custom_workload.set_parameter("test_param", 10)
|
||||
@@ -109,7 +109,7 @@ class CustomWorkloadTestSuite(unittest.TestCase):
|
||||
del self.custom_workload.get_parameters()["test_param"]
|
||||
|
||||
def test_override_parameter(self) -> None:
|
||||
# Tests `CustomResource.set_parameter` for the case where we override
|
||||
# Tests `CustomWorkload.set_parameter` for the case where we override
|
||||
# a parameter's value.
|
||||
|
||||
old_value = self.custom_workload.get_parameters()["binary"]
|
||||
|
||||
Reference in New Issue
Block a user