Beispiel #1
0
 def test_get_external_api_invalid(self):
     """
     Validate retrieving a non-existent external API which should raise an
     `IndexError` exception.
     """
     core = MimicCore(Clock(), [])
     with self.assertRaises(ServiceDoesNotExist):
         core.get_external_api(self.eeapi_name)
Beispiel #2
0
 def test_get_external_api_invalid(self):
     """
     Validate retrieving a non-existent external API which should raise an
     `IndexError` exception.
     """
     core = MimicCore(Clock(), [])
     with self.assertRaises(ServiceDoesNotExist):
         core.get_external_api(self.eeapi_name)
Beispiel #3
0
    def test_get_external_api(self):
        """
        Validate retrieving an external API.
        """
        eeapi = make_example_external_api(self,
                                          name=self.eeapi_name,
                                          set_enabled=True)

        core = MimicCore(Clock(), [eeapi])
        api_from_core = core.get_external_api(eeapi.uuid_key)
        self.assertEqual(eeapi, api_from_core)
Beispiel #4
0
    def test_get_external_api(self):
        """
        Validate retrieving an external API.
        """
        eeapi = make_example_external_api(
            self,
            name=self.eeapi_name,
            set_enabled=True
        )

        core = MimicCore(Clock(), [eeapi])
        api_from_core = core.get_external_api(
            eeapi.uuid_key
        )
        self.assertEqual(eeapi, api_from_core)