Example #1
0
 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')
Example #2
0
 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)