def test_badboxuse(self): """test that IO on a box name that doesn't exist will fail.""" component = LikeFile(DyingShunt()) component.activate() self.failUnlessRaises(KeyError, component.put, "boo", "nonsensesendbox") self.failUnlessRaises(KeyError, component.get, "nonsensesendbox") component.shutdown()
def test_closed(self): """test that creating, activating, and then closing a likefile wrapper will result in an object you're not allowed to perform IO on.""" component = LikeFile(DyingShunt()) component.activate() time.sleep(0.1) component.shutdown() time.sleep(0.1) self.failUnlessRaises(AttributeError, component.get) self.failUnlessRaises(AttributeError, component.put, "boo")