Exemplo n.º 1
0
def test_POST_raises():
    request = get(verb="post")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 2
0
def test_relative_url_raises():
    request = get("/just/a/path/")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 3
0
def test_localhost_raises():
    request = get("http://localhost/path/")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 4
0
 def test_POST_raises(self):
     request = self.buildRequest(verb="post")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 5
0
def test_good_request_passes():
    target = "http://osm.org/georss.xml"
    request = get(target)
    url = validate_url(request)
    assert url == target
Exemplo n.º 6
0
 def test_relative_url_raises(self):
     request = self.buildRequest("/just/a/path/")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 7
0
 def test_localhost_raises(self):
     request = self.buildRequest("http://localhost/path/")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 8
0
def test_unkown_domain_raises():
    request = get("http://xlkjdkjsdlkjfd.com")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 9
0
 def test_good_request_passes(self):
     target = "http://osm.org/georss.xml"
     request = self.buildRequest(target)
     url = validate_url(request)
     self.assertEquals(url, target)
Exemplo n.º 10
0
def test_local_IP_raises():
    url = "http://{}/path/".format(socket.gethostname())
    request = get(url)
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 11
0
def test_POST_raises():
    request = get(verb="post")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 12
0
def test_localhost_raises():
    request = get("http://localhost/path/")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 13
0
def test_file_uri_raises():
    request = get("file:///etc/passwd")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 14
0
def test_relative_url_raises():
    request = get("/just/a/path/")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 15
0
def test_no_url_raises():
    request = get("")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 16
0
 def test_no_url_raises(self):
     request = self.buildRequest("")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 17
0
 def test_no_url_raises(self):
     request = self.buildRequest("")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 18
0
 def test_relative_url_raises(self):
     request = self.buildRequest("/just/a/path/")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 19
0
 def test_file_uri_raises(self):
     request = self.buildRequest("file:///etc/passwd")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 20
0
 def test_file_uri_raises(self):
     request = self.buildRequest("file:///etc/passwd")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 21
0
 def test_local_IP_raises(self):
     url = "http://{}/path/".format(socket.gethostname())
     request = self.buildRequest(url)
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 22
0
 def test_localhost_raises(self):
     request = self.buildRequest("http://localhost/path/")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 23
0
 def test_unkown_domain_raises(self):
     request = self.buildRequest("http://xlkjdkjsdlkjfd.com")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 24
0
 def test_local_IP_raises(self):
     url = "http://{}/path/".format(socket.gethostname())
     request = self.buildRequest(url)
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 25
0
def test_no_url_raises():
    request = get("")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 26
0
 def test_POST_raises(self):
     request = self.buildRequest(verb="post")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 27
0
def test_file_uri_raises():
    request = get("file:///etc/passwd")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 28
0
 def test_unkown_domain_raises(self):
     request = self.buildRequest("http://xlkjdkjsdlkjfd.com")
     with self.assertRaises(AssertionError):
         validate_url(request)
Exemplo n.º 29
0
def test_local_IP_raises():
    url = "http://{}/path/".format(socket.gethostname())
    request = get(url)
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 30
0
 def test_good_request_passes(self):
     target = "http://osm.org/georss.xml"
     request = self.buildRequest(target)
     url = validate_url(request)
     self.assertEquals(url, target)
Exemplo n.º 31
0
def test_unkown_domain_raises():
    request = get("http://xlkjdkjsdlkjfd.com")
    with pytest.raises(AssertionError):
        validate_url(request)
Exemplo n.º 32
0
def test_good_request_passes():
    target = "http://osm.org/georss.xml"
    request = get(target)
    url = validate_url(request)
    assert url == target