tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_url.py (478B)


      1 #!/usr/bin/env python
      2 
      3 """
      4 tests for is_url
      5 """
      6 
      7 import unittest
      8 
      9 import mozunit
     10 from mozfile import is_url
     11 
     12 
     13 class TestIsUrl(unittest.TestCase):
     14    """test the is_url function"""
     15 
     16    def test_is_url(self):
     17        self.assertTrue(is_url("http://mozilla.org"))
     18        self.assertFalse(is_url("/usr/bin/mozilla.org"))
     19        self.assertTrue(is_url("file:///usr/bin/mozilla.org"))
     20        self.assertFalse(is_url("c:\foo\bar"))
     21 
     22 
     23 if __name__ == "__main__":
     24    mozunit.main()