Exemple #1
0
    def test_requests_for_paths_that_are_not_of_an_lfa_return_none(self):
        request = 'GET https://launchpadlibrarian.net/ HTTP/1.1'
        self.assertEqual(get_library_file_id(get_method_and_path(request)[1]),
                         None)

        request = 'GET /robots.txt HTTP/1.1'
        self.assertEqual(get_library_file_id(get_method_and_path(request)[1]),
                         None)

        request = 'GET /@@person HTTP/1.1'
        self.assertEqual(get_library_file_id(get_method_and_path(request)[1]),
                         None)
    def test_requests_for_paths_that_are_not_of_an_lfa_return_none(self):
        request = 'GET https://launchpadlibrarian.net/ HTTP/1.1'
        self.assertEqual(
            get_library_file_id(get_method_and_path(request)[1]), None)

        request = 'GET /robots.txt HTTP/1.1'
        self.assertEqual(
            get_library_file_id(get_method_and_path(request)[1]), None)

        request = 'GET /@@person HTTP/1.1'
        self.assertEqual(
            get_library_file_id(get_method_and_path(request)[1]), None)
 def getDownloadKey(self, path):
     """See `ParseApacheLogs`."""
     return get_library_file_id(path)
Exemple #4
0
 def getDownloadKey(self, path):
     """See `ParseApacheLogs`."""
     return get_library_file_id(path)
Exemple #5
0
 def assertMethodAndFileIDAreCorrect(self, request):
     method, path = get_method_and_path(request)
     file_id = get_library_file_id(path)
     self.assertEqual(method, 'GET')
     self.assertEqual(file_id, '8196569')
 def assertMethodAndFileIDAreCorrect(self, request):
     method, path = get_method_and_path(request)
     file_id = get_library_file_id(path)
     self.assertEqual(method, 'GET')
     self.assertEqual(file_id, '8196569')