Example #1
0
 def test_simple_service(self):
     composition = edf_parser.create_service_composition_from_edf(
         SIMPLE_SERVICE_FILE)
     self.assertFalse(composition.is_empty())
     self.assertEqual(1, composition.get_service_count())
     service = composition.get_service(
         composition.get_service_key_list()[0])
     self.assertEqual("foo", service._id)
     self.assertEqual("hello-world", service._tag)
Example #2
0
 def test_multiple_services(self):
     composition = edf_parser.create_service_composition_from_edf(
         MULTIPLE_SERVICES_FILE)
     self.assertFalse(composition.is_empty())
     self.assertEqual(4, composition.get_service_count())
     correct_ids = ["foo", "bar", "baz", "foobar"]
     correct_tags = [
         "hello-world", "hello-python", "hello-minden", "hello-foobar"
     ]
     ids = []
     tags = []
     for service_key in composition.get_service_key_list():
         service = composition.get_service(service_key)
         ids.append(service._id)
         tags.append(service._tag)
     self.assertEqual(sorted(correct_ids), sorted(ids))
     self.assertEqual(sorted(correct_tags), sorted(tags))
Example #3
0
 def setUp(self):
     self.master_id = "rosmaster"
     self.camera_id = "camera"
     self.composition = edf_parser.create_service_composition_from_edf(
         COMPLEX_FILE)
Example #4
0
 def test_malformed(self):
     try:
         edf_parser.create_service_composition_from_edf(MALFORMED_FILE)
         self.fail(msg="Malformed edf files should not be loaded")
     except CompositionException:
         pass
Example #5
0
 def test_comment(self):
     composition = edf_parser.create_service_composition_from_edf(
         COMMENT_FILE)
     self.assertFalse(composition.is_empty())
     self.assertEqual(1, composition.get_service_count())
Example #6
0
 def test_correct_assignment(self):
     composition = edf_parser.create_service_composition_from_edf(
         MULTIPLE_SERVICES_FILE)
     self.assertEqual("hello-python", composition._services["bar"]._tag)
     self.assertEqual("hello-foobar", composition._services["foobar"]._tag)
Example #7
0
 def test_version_file(self):
     composition = edf_parser.create_service_composition_from_edf(
         VERSION_FILE)
     self.assertEqual("3", composition._version)
     self.assertTrue(composition.is_empty())
Example #8
0
 def test_empty_file(self):
     composition = edf_parser.create_service_composition_from_edf(
         EMPTY_FILE)
     self.assertTrue(composition.is_empty())
Example #9
0
 def test_non_existent_file(self):
     composition = edf_parser.create_service_composition_from_edf(
         "non_existent_file.yaml")
     self.assertTrue(composition.is_empty())
 def setUp(self):
     self.swarm_engine = default_setup()
     self.composition = edf_parser.create_service_composition_from_edf(
         COMPOSITION_FILE)