Exemplo n.º 1
0
 def test_repair(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     sender.repair()
     _impl.repair.assert_called_with()
Exemplo n.º 2
0
 def test_repair(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     sender.repair()
     _impl.repair.assert_called_with()
Exemplo n.º 3
0
 def test_close(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     # soft
     sender.close()
     _impl.close.assert_called_with()
Exemplo n.º 4
0
 def test_is_open(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     is_open = sender.is_open()
     _impl.is_open.assert_called_with()
     self.assertEqual(is_open, _impl.is_open.return_value)
Exemplo n.º 5
0
 def test_close(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     # soft
     sender.close()
     _impl.close.assert_called_with()
Exemplo n.º 6
0
 def test_is_open(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     is_open = sender.is_open()
     _impl.is_open.assert_called_with()
     self.assertEqual(is_open, _impl.is_open.return_value)
Exemplo n.º 7
0
 def test_send(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     address = Mock()
     content = '1234'
     ttl = 10
     sender = Sender(url)
     sender.durable = 18
     sender.send(address, content, ttl)
     _impl.send.assert_called_once_with(address, content, ttl)
     self.assertEqual(sender.durable, _impl.durable)
Exemplo n.º 8
0
 def test_send(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     address = Mock()
     content = '1234'
     ttl = 10
     sender = Sender(url)
     sender.durable = 18
     sender.send(address, content, ttl)
     _impl.send.assert_called_once_with(address, content, ttl)
     self.assertEqual(sender.durable, _impl.durable)
Exemplo n.º 9
0
 def test_init(self, _find):
     _impl = Mock()
     plugin = Mock()
     plugin.Sender.return_value = _impl
     _find.return_value = plugin
     url = TEST_URL
     sender = Sender(url)
     self.assertEqual(sender._impl, _impl)
     self.assertTrue(isinstance(sender, BaseSender))