コード例 #1
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")
コード例 #2
0
ファイル: test_url.py プロジェクト: johnjohnsp1/w3af
    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
ファイル: test_url.py プロジェクト: 3rdDegree/w3af
 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')
コード例 #4
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")
コード例 #5
0
ファイル: test_url.py プロジェクト: johnjohnsp1/w3af
    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
ファイル: test_url.py プロジェクト: 3rdDegree/w3af
    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')