def test_build_site(self):
     network = Livefyre.get_network(self.NETWORK_NAME, self.NETWORK_KEY)
     data = SiteData(self.SITE_ID, self.SITE_KEY)
     
     site = Site(network, data)
     self.assertEquals(network, site.network)
     self.assertEquals(data, site.data)
     
     Site.init(network, self.SITE_ID, self.SITE_KEY)
     if pyver < 2.7:
         pass
     elif pyver < 3.0:
         with self.assertRaisesRegexp(AssertionError, 'id is missing'):
             Site.init(network, None, self.SITE_KEY)
         with self.assertRaisesRegexp(AssertionError, 'key is missing'):
             Site.init(network, self.SITE_ID, None)
     else:
         with self.assertRaisesRegex(AssertionError, 'id is missing'):
             Site.init(network, None, self.SITE_KEY)
         with self.assertRaisesRegex(AssertionError, 'key is missing'):
             Site.init(network, self.SITE_ID, None)
Esempio n. 2
0
 def get_site(self, site_id, site_key):
     return Site.init(self, site_id, site_key)