示例#1
0
文件: tests.py 项目: mpub/van_api
 def test_get_path_assertion_error(self):
     from van_api import _HTTPConnection
     one = _HTTPConnection(host='ex.example.com')
     self.assertRaises(AssertionError, one._get_path, 'http://ex.example.com/abc?x=55')
     self.assertRaises(AssertionError, one._get_path, 'https://exe.example.com/abc?x=55')
     path = one._get_path('https://ex.example.com/abc?x=55')
     self.assertEqual(path, '/abc?x=55')
示例#2
0
文件: tests.py 项目: mpub/van_api
 def _one(self, host='example.org', conn_factory=None, logger=None):
     from van_api import _HTTPConnection
     if conn_factory is None:
         conn_factory = self._conn_factory()
     return _HTTPConnection(host, conn_factory=conn_factory, logger=logger)