Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(12)  |  Derive(0)  |  Import(2)

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_client.py   MapProxy(Download)
from mapproxy.test.unit.test_cache import MockHTTPClient
from mapproxy.test.http import mock_httpd, query_eq, assert_query_eq
from mapproxy.test.helper import assert_re, TempFile
 
from nose.tools import eq_
                self.client.open(TESTSERVER_URL + '/')
        except HTTPClientError, e:
            assert_re(e.args[0], r'HTTP Error ".*": 500')
        else:
            assert False, 'expected HTTPClientError'
    def test_invalid_url_type(self):
        try:
            self.client.open('htp://example.org')
        except HTTPClientError, e:
            assert_re(e.args[0], r'No response .* "htp://example.*": unknown url type')
    def test_invalid_url(self):
        try:
            self.client.open('this is not a url')
        except HTTPClientError, e:
            assert_re(e.args[0], r'URL not correct "this is not.*": unknown url type')
    def test_unknown_host(self):
        try:
            self.client.open('http://thishostshouldnotexist000136really42.org')
        except HTTPClientError, e:
            assert_re(e.args[0], r'No response .* "http://thishost.*": .*')

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_client.py   mapproxy(Download)
from mapproxy.test.unit.test_cache import MockHTTPClient
from mapproxy.test.http import mock_httpd, query_eq, assert_query_eq
from mapproxy.test.helper import assert_re, TempFile
 
from nose.tools import eq_
                self.client.open(TESTSERVER_URL + '/')
        except HTTPClientError, e:
            assert_re(e.args[0], r'HTTP Error ".*": 500')
        else:
            assert False, 'expected HTTPClientError'
    def test_invalid_url_type(self):
        try:
            self.client.open('htp://example.org')
        except HTTPClientError, e:
            assert_re(e.args[0], r'No response .* "htp://example.*": unknown url type')
    def test_invalid_url(self):
        try:
            self.client.open('this is not a url')
        except HTTPClientError, e:
            assert_re(e.args[0], r'URL not correct "this is not.*": unknown url type')
    def test_unknown_host(self):
        try:
            self.client.open('http://thishostshouldnotexist000136really42.org')
        except HTTPClientError, e:
            assert_re(e.args[0], r'No response .* "http://thishost.*": .*')