Commit 95c20d5b authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][algorithm] Update test for new loop block types

parent cfe2d8cf
......@@ -234,6 +234,24 @@ class TestSequentialAPI_Loading(unittest.TestCase):
self.assertFalse(runnable.ready)
self.assertFalse(runnable.prepared)
def test_load_valid_loop(self):
algorithm = Algorithm(prefix, "sequential/loop/1")
self.assertEqual(algorithm.name, "sequential/loop/1")
self.assertTrue(algorithm.valid)
self.assertFalse(algorithm.errors)
self.assertFalse(algorithm.results) # it is not an analyzer
self.assertTrue(algorithm.parameters) # does not contain parameters
self.assertTrue(algorithm.input_map)
self.assertTrue(algorithm.output_map)
self.assertEqual(algorithm.schema_version, 3)
self.assertEqual(algorithm.api_version, 2)
self.assertEqual(algorithm.type, Algorithm.SEQUENTIAL_LOOP)
runnable = algorithm.runner()
self.assertFalse(runnable.ready)
self.assertTrue(runnable.prepared)
def test_load_valid_loop_user(self):
algorithm = Algorithm(prefix, "sequential/loop_user/1")
self.assertEqual(algorithm.name, "sequential/loop_user/1")
......@@ -303,30 +321,7 @@ class TestAutonomousAPI_Loading(unittest.TestCase):
self.assertFalse(runnable.ready)
self.assertFalse(runnable.prepared)
def test_load_valid_loop_user(self):
algorithm = Algorithm(prefix, "autonomous/loop_user/1")
self.assertEqual(algorithm.name, "autonomous/loop_user/1")
self.assertTrue(algorithm.valid)
self.assertFalse(algorithm.errors)
self.assertFalse(algorithm.results) # it is not an analyzer
self.assertFalse(algorithm.parameters) # does not contain parameters
self.assertTrue(algorithm.input_map)
self.assertTrue(algorithm.output_map)
self.assertEqual(algorithm.schema_version, 3)
self.assertEqual(algorithm.api_version, 2)
self.assertEqual(algorithm.type, Algorithm.AUTONOMOUS_LOOP_USER)
runnable = algorithm.runner()
self.assertTrue(runnable.ready)
self.assertTrue(runnable.prepared)
# ----------------------------------------------------------
class TestLoopAPI_Loading(unittest.TestCase):
def test_load_valid_algorithm(self):
def test_load_valid_loop(self):
algorithm = Algorithm(prefix, "autonomous/loop/1")
self.assertEqual(algorithm.name, "autonomous/loop/1")
self.assertTrue(algorithm.valid)
......@@ -338,7 +333,7 @@ class TestLoopAPI_Loading(unittest.TestCase):
self.assertTrue(algorithm.output_map)
self.assertEqual(algorithm.schema_version, 3)
self.assertEqual(algorithm.api_version, 2)
self.assertEqual(algorithm.type, Algorithm.LOOP)
self.assertEqual(algorithm.type, Algorithm.AUTONOMOUS_LOOP)
runnable = algorithm.runner()
self.assertFalse(runnable.ready)
......@@ -346,19 +341,14 @@ class TestLoopAPI_Loading(unittest.TestCase):
runnable.prepared
) # loop/1 has no prepare method so is prepared
# ----------------------------------------------------------
class TestLoopUserAPI_Loading(unittest.TestCase):
def test_load_valid_algorithm(self):
def test_load_valid_loop_user(self):
algorithm = Algorithm(prefix, "autonomous/loop_user/1")
self.assertEqual(algorithm.name, "autonomous/loop_user/1")
self.assertTrue(algorithm.valid)
self.assertFalse(algorithm.errors)
self.assertFalse(algorithm.results) # it is not an analyzer
self.assertFalse(algorithm.parameters) # loop_user/1 has no parameter
self.assertFalse(algorithm.parameters) # does not contain parameters
self.assertTrue(algorithm.input_map)
self.assertTrue(algorithm.output_map)
self.assertEqual(algorithm.schema_version, 3)
......@@ -366,10 +356,8 @@ class TestLoopUserAPI_Loading(unittest.TestCase):
self.assertEqual(algorithm.type, Algorithm.AUTONOMOUS_LOOP_USER)
runnable = algorithm.runner()
self.assertTrue(runnable.ready) # loop_user/1 has no setup method so is ready
self.assertTrue(
runnable.prepared
) # loop/1 has no prepare method so is prepared
self.assertTrue(runnable.ready)
self.assertTrue(runnable.prepared)
# ----------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment