Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/s/i/silva.app.forest-3.0.1/src/silva/app/forest/tests/test_utils.py   silva.app.forest(Download)
import unittest
 
from ..utils import url2tuple
 
from zExceptions import BadRequest
 
        with self.assertRaises(BadRequest):
            url2tuple('http://infrae.com/../docs/admin')
        with self.assertRaises(BadRequest):
            url2tuple('http://infrae.com/docs/../../..')

src/s/i/silva.app.forest-3.0.1/src/silva/app/forest/tests/test_service.py   silva.app.forest(Download)
from ..service import VirtualHost, Rewrite
from ..testing import FunctionalLayer
from ..utils import url2tuple
 
 
 
        # Test host
        query_host = service.query(url2tuple('http://infrae.com'))
        self.assertIsNot(query_host, None)
        self.assertEqual(query_host.url, 'http://infrae.com')
 
        # Test host
        query_host = service.query(url2tuple('http://infrae.com'))
        self.assertIs(query_host, None)
        query_host = service.query(url2tuple('http://infrae.com/docs'))
 
        # Test query
        query_host = service.query(url2tuple('http://infrae.com'))
        self.assertIsNot(query_host, None)
        self.assertEqual(query_host.url, 'http://infrae.com')