def test_remBuilder(self): """ Should remove from the _builders list """ h = Hub() o = object() h._builders = [o] h.remBuilder(o) self.assertEqual(h._builders, []) h.remBuilder(o) self.assertEqual(h._builders, [])
def test_remote_remBuilder(self): """ Should wrap the remote then call remBuilder """ h = Hub() h.remoteHubFactory = FakeRemoteHub called = [] h.remBuilder = called.append h.remote_remBuilder('foo') self.assertEqual(len(called), 1) r = called[0] self.assertTrue(isinstance(r, FakeRemoteHub)) self.assertEqual(r.original, 'foo')