def test_simplest_url(self):
        u = URL("http://w3af.com/foo/bar.txt")

        self.assertEqual(u.path, "/foo/bar.txt")
        self.assertEqual(u.scheme, "http")
        self.assertEqual(u.get_file_name(), "bar.txt")
        self.assertEqual(u.get_extension(), "txt")
示例#2
0
    def test_simplest_url(self):
        u = URL('http://w3af.com/foo/bar.txt')

        self.assertEqual(u.path, '/foo/bar.txt')
        self.assertEqual(u.scheme, 'http')
        self.assertEqual(u.get_file_name(), 'bar.txt')
        self.assertEqual(u.get_extension(), 'txt')
示例#3
0
 def test_simplest_url(self):
     u = URL('http://w3af.com/foo/bar.txt')
     
     self.assertEqual(u.path, '/foo/bar.txt')
     self.assertEqual(u.scheme, 'http')
     self.assertEqual(u.get_file_name(), 'bar.txt')
     self.assertEqual(u.get_extension(), 'txt')
    def test_set_filename(self):
        u = URL("https://w3af.com:443/xyz/def.html")
        u.set_file_name("abc.pdf")
        self.assertEqual(u.url_string, "https://w3af.com/xyz/abc.pdf")
        self.assertEqual(u.get_file_name(), "abc.pdf")

        u = URL("https://w3af.com/xyz/def.html?id=1")
        u.set_file_name("abc.pdf")
        self.assertEqual(u.url_string, "https://w3af.com/xyz/abc.pdf?id=1")

        u = URL("https://w3af.com/xyz/def.html?file=/etc/passwd")
        u.set_file_name("abc.pdf")
        self.assertEqual(u.url_string, "https://w3af.com/xyz/abc.pdf?file=/etc/passwd")

        u = URL("https://w3af.com/")
        u.set_file_name("abc.pdf")
        self.assertEqual(u.url_string, "https://w3af.com/abc.pdf")
示例#5
0
    def test_set_filename(self):
        u = URL('https://w3af.com:443/xyz/def.html')
        u.set_file_name('abc.pdf')
        self.assertEqual(u.url_string, 'https://w3af.com/xyz/abc.pdf')
        self.assertEqual(u.get_file_name(), 'abc.pdf')

        u = URL('https://w3af.com/xyz/def.html?id=1')
        u.set_file_name('abc.pdf')
        self.assertEqual(u.url_string, 'https://w3af.com/xyz/abc.pdf?id=1')

        u = URL('https://w3af.com/xyz/def.html?file=/etc/passwd')
        u.set_file_name('abc.pdf')
        self.assertEqual(u.url_string,
                         'https://w3af.com/xyz/abc.pdf?file=/etc/passwd')

        u = URL('https://w3af.com/')
        u.set_file_name('abc.pdf')
        self.assertEqual(u.url_string, 'https://w3af.com/abc.pdf')
示例#6
0
    def test_set_filename(self):
        u = URL('https://w3af.com:443/xyz/def.html')
        u.set_file_name( 'abc.pdf' )
        self.assertEqual(u.url_string,
                         'https://w3af.com/xyz/abc.pdf')
        self.assertEqual(u.get_file_name(), 'abc.pdf')

        u = URL('https://w3af.com/xyz/def.html?id=1')
        u.set_file_name( 'abc.pdf' )
        self.assertEqual(u.url_string,
                         'https://w3af.com/xyz/abc.pdf?id=1')

        u = URL('https://w3af.com/xyz/def.html?file=/etc/passwd')
        u.set_file_name( 'abc.pdf' )
        self.assertEqual(u.url_string,
                         'https://w3af.com/xyz/abc.pdf?file=/etc/passwd')

        u = URL('https://w3af.com/')
        u.set_file_name( 'abc.pdf' )
        self.assertEqual(u.url_string,
                         'https://w3af.com/abc.pdf')