Пример #1
0
 def test_sentry_project_notfound_no_location(self):
     # For sentry:project status=notfound the location needs to be removed
     debug_id = "451a38b5-0679-79d2-0738-22a5ceb24c4b"
     candidates = [
         {
             "source": "sentry:project",
             "location": "Not the locacation you are looking for",
             "download": {
                 "status": "notfound"
             },
         },
     ]
     response = {
         "modules": [{
             "debug_id": debug_id,
             "candidates": copy.copy(candidates)
         }]
     }
     redact_internal_sources(response)
     expected = [{
         "source": "sentry:project",
         "download": {
             "status": "notfound"
         }
     }]
     assert response["modules"][0]["candidates"] == expected
Пример #2
0
 def test_notfound_omitted(self):
     debug_id = "451a38b5-0679-79d2-0738-22a5ceb24c4b"
     candidates = [
         {
             "source": "sentry:microsoft",
             "location": "http://microsoft.com/prefix/path0",
             "download": {
                 "status": "notfound"
             },
         },
         {
             "source": "sentry:microsoft",
             "location": "http://microsoft.com/prefix/path1",
             "download": {
                 "status": "ok"
             },
         },
     ]
     response = {
         "modules": [{
             "debug_id": debug_id,
             "candidates": copy.copy(candidates)
         }]
     }
     redact_internal_sources(response)
     expected = [{
         "source": "sentry:microsoft",
         "download": {
             "status": "ok"
         }
     }]
     assert response["modules"][0]["candidates"] == expected
Пример #3
0
 def test_sentry_project(self):
     debug_id = "451a38b5-0679-79d2-0738-22a5ceb24c4b"
     candidates = [
         {
             "source": "sentry:project",
             "location": "sentry://project_debug_file/123",
             "download": {
                 "status": "ok"
             },
         },
     ]
     response = {
         "modules": [{
             "debug_id": debug_id,
             "candidates": copy.copy(candidates)
         }]
     }
     redact_internal_sources(response)
     expected = [
         {
             "source": "sentry:project",
             "location": "sentry://project_debug_file/123",
             "download": {
                 "status": "ok"
             },
         },
     ]
     assert response["modules"][0]["candidates"] == expected
Пример #4
0
 def test_custom_untouched(self):
     debug_id = "451a38b5-0679-79d2-0738-22a5ceb24c4b"
     candidates = [
         {
             "source": "custom",
             "location": "http://example.net/prefix/path",
             "download": {
                 "status": "ok"
             },
         },
     ]
     response = {
         "modules": [{
             "debug_id": debug_id,
             "candidates": copy.copy(candidates)
         }]
     }
     redact_internal_sources(response)
     assert response["modules"][0]["candidates"] == candidates