Beispiel #1
0
 def update(self):
     if not self.structure:
         s_endpoints = endpoints.get_structure()
         s_url2embed = url2embed_structure.get_structure()
         s_api2embed = api2embed_structure.get_structure()
         for providers in (s_endpoints, s_url2embed, s_api2embed):
             for hostname in providers:
                 if hostname not in self.structure:
                     self.structure[hostname] = []
                 infos = providers[hostname]
                 for info in infos:
                     self.structure[hostname].append(info)
Beispiel #2
0
 def update(self):
     if not self.structure:
         s_endpoints = endpoints.get_structure()
         s_url2embed = url2embed_structure.get_structure()
         s_api2embed = api2embed_structure.get_structure()
         for providers in (s_endpoints, s_url2embed, s_api2embed):
             for hostname in providers:
                 if hostname not in self.structure:
                     self.structure[hostname] = []
                 infos = providers[hostname]
                 for info in infos:
                     self.structure[hostname].append(info)
 def test_get_structure(self):
     from collective.oembed import endpoints
     structure = endpoints.get_structure()
     len_endpoints = len(structure)
     self.assertTrue(len_endpoints > 0)
     for hostname in structure:
         endpoints = structure[hostname]
         for endpoint in endpoints:
             self.assertIn(u'regex', endpoint)
             self.assertIn(u'factory', endpoint)
             self.assertIn(u'consumer', endpoint)
             self.assertIn(u'endpoint', endpoint)
             endpoint_instance = endpoint['factory'](endpoint)
             self.assertIsNotNone(endpoint_instance)
             consumer_instance = endpoint['consumer'](endpoint_instance)
             self.assertIsNotNone(consumer_instance)