def test_exit(self, _close): messenger = Messenger(TEST_URL) messenger.__exit__() _close.assert_called_with()
def test_enter(self, _open): messenger = Messenger(TEST_URL) retval = messenger.__enter__() _open.assert_called_once_with() self.assertEqual(messenger, retval)
def test_abstract(self): messenger = Messenger(TEST_URL) self.assertRaises(NotImplementedError, messenger.is_open) self.assertRaises(NotImplementedError, messenger.open) self.assertRaises(NotImplementedError, messenger.repair) self.assertRaises(NotImplementedError, messenger.close)
def test_init(self): messenger = Messenger(TEST_URL) self.assertTrue(isinstance(messenger, Model)) self.assertEqual(messenger.url, TEST_URL)