def test_not_match(self):
     """Tests not matching."""
     self.assertIsNone(
         testcase_manager.convert_dependency_url_to_local_path(
             'http://www.google.com/test.'))
     self.assertIsNone(
         testcase_manager.convert_dependency_url_to_local_path('random'))
     self.assertEqual(0, self.mock.normalize_path.call_count)
 def test_file_match_windows(self):
     """Tests matching a file URL."""
     self.mock.platform.return_value = 'WINDOWS'
     self.assertEqual(
         'C:/test/test.html',
         testcase_manager.convert_dependency_url_to_local_path(
             'file:///C:/test/test.html'))
     self.mock.normalize_path.assert_called_once_with('C:/test/test.html')
Exemple #3
0
 def test_file_match_linux(self):
   """Tests matching a file URL."""
   self.mock.platform.return_value = 'LINUX'
   self.assertEqual(
       '/mnt/scratch0/test.html',
       testcase_manager.convert_dependency_url_to_local_path(
           'file:///mnt/scratch0/test.html'))
   self.mock.normalize_path.assert_called_once_with('/mnt/scratch0/test.html')
Exemple #4
0
 def test_file_match_android(self):
   """Tests matching a file URL."""
   self.mock.platform.return_value = 'ANDROID'
   self.assertEqual(
       '/mnt/scratch0/test.html',
       testcase_manager.convert_dependency_url_to_local_path(
           'file:///sdcard/fuzzer-testcases/test.html'))
   self.mock.normalize_path.assert_called_once_with('/mnt/scratch0/test.html')
 def test_url_match_127_0_0_1_with_port(self):
     """Tests matching a URL (127.0.0.1)."""
     self.mock.get_absolute_testcase_file.return_value = '/path'
     self.assertEqual(
         '/path',
         testcase_manager.convert_dependency_url_to_local_path(
             'http://127.0.0.1:8000/test/test.html'))
     self.mock.get_absolute_testcase_file.assert_called_once_with(
         '/test/test.html')
     self.mock.normalize_path.assert_called_once_with('/path')
 def test_url_match_any_ip_and_port(self):
     """Tests matching a URL (any ip and port)."""
     self.mock.get_absolute_testcase_file.return_value = '/path'
     self.assertEqual(
         '/path',
         testcase_manager.convert_dependency_url_to_local_path(
             'http://10.240.1.237:8002/test/test.html'))
     self.mock.get_absolute_testcase_file.assert_called_once_with(
         '/test/test.html')
     self.mock.normalize_path.assert_called_once_with('/path')