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)
def test_implements_interface(self): self.assertTrue(IClient.implementedBy(Client)) verifyClass(IClient, Client)