示例#1
0
 def test_exit(self, _close):
     messenger = Messenger(TEST_URL)
     messenger.__exit__()
     _close.assert_called_with()
示例#2
0
 def test_enter(self, _open):
     messenger = Messenger(TEST_URL)
     retval = messenger.__enter__()
     _open.assert_called_once_with()
     self.assertEqual(messenger, retval)
示例#3
0
 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)
示例#4
0
 def test_init(self):
     messenger = Messenger(TEST_URL)
     self.assertTrue(isinstance(messenger, Model))
     self.assertEqual(messenger.url, TEST_URL)
示例#5
0
 def test_exit(self, _close):
     messenger = Messenger(TEST_URL)
     messenger.__exit__()
     _close.assert_called_with()
示例#6
0
 def test_enter(self, _open):
     messenger = Messenger(TEST_URL)
     retval = messenger.__enter__()
     _open.assert_called_once_with()
     self.assertEqual(messenger, retval)