コード例 #1
0
ファイル: connection.py プロジェクト: stbenjam/gofer
 def __init__(self, url):
     """
     :param url: The connector url.
     :type url: str
     """
     BaseConnection.__init__(self, url)
     self._impl = None
コード例 #2
0
ファイル: connection.py プロジェクト: credativ/gofer
 def __init__(self, url):
     """
     :param url: The broker url.
     :type url: str
     """
     BaseConnection.__init__(self, url)
     self._impl = None
コード例 #3
0
 def test_exit(self, _close):
     connection = BaseConnection(TEST_URL)
     connection.__exit__()
     _close.assert_called_with()
コード例 #4
0
 def test_enter(self, _open):
     connection = BaseConnection(TEST_URL)
     retval = connection.__enter__()
     _open.assert_called_once_with()
     self.assertEqual(connection, retval)
コード例 #5
0
 def test_str(self):
     connection = BaseConnection(TEST_URL)
     self.assertEqual(str(connection), TEST_URL)
コード例 #6
0
 def test_abstract(self):
     connection = BaseConnection(TEST_URL)
     self.assertRaises(NotImplementedError, connection.is_open)
     self.assertRaises(NotImplementedError, connection.open)
     self.assertRaises(NotImplementedError, connection.close)
コード例 #7
0
 def test_init(self):
     connection = BaseConnection(TEST_URL)
     self.assertEqual(connection.url, TEST_URL)
     self.assertTrue(connection.retry)
コード例 #8
0
ファイル: test_model.py プロジェクト: credativ/gofer
 def test_exit(self, _close):
     connection = BaseConnection(TEST_URL)
     connection.__exit__()
     _close.assert_called_with()
コード例 #9
0
ファイル: test_model.py プロジェクト: credativ/gofer
 def test_enter(self, _open):
     connection = BaseConnection(TEST_URL)
     retval = connection.__enter__()
     _open.assert_called_once_with()
     self.assertEqual(connection, retval)
コード例 #10
0
ファイル: test_model.py プロジェクト: pombreda/gofer
 def test_unicode(self):
     connection = BaseConnection(TEST_URL)
     self.assertEqual(unicode(connection), TEST_URL)