Exemplo n.º 1
0
    def test_get_client_by_id(self):
        manager = queryUtility(IClientManager)

        foo = manager.get_client_by_id('foo')
        self.assertTrue(IClient.providedBy(foo))
        self.assertEqual(foo.clientid, 'foo')
        self.assertEqual(manager.get_client_by_id('foo2'), foo)

        bar = manager.get_client_by_id('bar')
        self.assertTrue(IClient.providedBy(bar))
        self.assertEqual(bar.clientid, 'bar')

        self.assertEqual(manager.get_client_by_id('unkown'), None)
        self.assertEqual(manager.get_client_by_id('foo3'), None)
Exemplo n.º 2
0
 def test_implements_interface(self):
     self.assertTrue(IClient.implementedBy(Client))
     verifyClass(IClient, Client)