|
6 | 6 | CommitFactory, |
7 | 7 | CommitWithReportFactory, |
8 | 8 | ) |
9 | | -from shared.reports.api_report_service import ( |
10 | | - build_report, |
11 | | - build_report_from_commit, |
12 | | -) |
| 9 | +from shared.reports.api_report_service import build_report_from_commit |
13 | 10 | from shared.reports.resources import Report, ReportFile |
14 | 11 | from shared.reports.types import ReportLine |
15 | 12 | from shared.storage.exceptions import FileNotInStorageError |
16 | 13 | from shared.utils.sessions import Session |
17 | 14 |
|
18 | 15 | from reports.tests.factories import UploadFactory, UploadFlagMembershipFactory |
19 | | -from services.report import ( |
20 | | - files_belonging_to_flags, |
21 | | -) |
| 16 | +from services.report import files_belonging_to_flags |
22 | 17 |
|
23 | 18 | current_file = Path(__file__) |
24 | 19 |
|
@@ -50,64 +45,6 @@ def sorted_files(report: Report) -> list[ReportFile]: |
50 | 45 |
|
51 | 46 |
|
52 | 47 | class ReportServiceTest(TestCase): |
53 | | - def test_report_generator(self): |
54 | | - data = { |
55 | | - "chunks": "{}\n[1, null, [[0, 1]]]\n\n\n[1, null, [[0, 1]]]\n[0, null, [[0, 0]]]\n<<<<< end_of_chunk >>>>>\n{}\n[1, null, [[0, 1]]]\n\n\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n\n\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n\n\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n<<<<< end_of_chunk >>>>>\n{}\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n\n\n[1, null, [[0, 1]]]\n[0, null, [[0, 0]]]\n\n\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n[1, null, [[0, 1]]]\n\n\n[1, null, [[0, 1]]]\n[0, null, [[0, 0]]]", |
56 | | - "files": { |
57 | | - "awesome/__init__.py": [ |
58 | | - 2, |
59 | | - [0, 10, 8, 2, 0, "80.00000", 0, 0, 0, 0, 0, 0, 0], |
60 | | - [[0, 10, 8, 2, 0, "80.00000", 0, 0, 0, 0, 0, 0, 0]], |
61 | | - [0, 2, 1, 1, 0, "50.00000", 0, 0, 0, 0, 0, 0, 0], |
62 | | - ], |
63 | | - "tests/__init__.py": [ |
64 | | - 0, |
65 | | - [0, 3, 2, 1, 0, "66.66667", 0, 0, 0, 0, 0, 0, 0], |
66 | | - [[0, 3, 2, 1, 0, "66.66667", 0, 0, 0, 0, 0, 0, 0]], |
67 | | - None, |
68 | | - ], |
69 | | - "tests/test_sample.py": [ |
70 | | - 1, |
71 | | - [0, 7, 7, 0, 0, "100", 0, 0, 0, 0, 0, 0, 0], |
72 | | - [[0, 7, 7, 0, 0, "100", 0, 0, 0, 0, 0, 0, 0]], |
73 | | - None, |
74 | | - ], |
75 | | - }, |
76 | | - "sessions": { |
77 | | - "0": { |
78 | | - "N": None, |
79 | | - "a": "v4/raw/2019-01-10/839C9EAF1A3F1CD45AA08DF5F791461F/abf6d4df662c47e32460020ab14abf9303581429/9ccc55a1-8b41-4bb1-a946-ee7a33a7fb56.txt", |
80 | | - "c": None, |
81 | | - "d": 1547084427, |
82 | | - "e": None, |
83 | | - "f": None, |
84 | | - "j": None, |
85 | | - "n": None, |
86 | | - "p": None, |
87 | | - "t": [3, 20, 17, 3, 0, "85.00000", 0, 0, 0, 0, 0, 0, 0], |
88 | | - "": None, |
89 | | - } |
90 | | - }, |
91 | | - "totals": { |
92 | | - "C": 0, |
93 | | - "M": 0, |
94 | | - "N": 0, |
95 | | - "b": 0, |
96 | | - "c": "85.00000", |
97 | | - "d": 0, |
98 | | - "diff": [1, 2, 1, 1, 0, "50.00000", 0, 0, 0, 0, 0, 0, 0], |
99 | | - "f": 3, |
100 | | - "h": 17, |
101 | | - "m": 3, |
102 | | - "n": 20, |
103 | | - "p": 0, |
104 | | - "s": 1, |
105 | | - }, |
106 | | - } |
107 | | - |
108 | | - res = build_report(**data) |
109 | | - assert len(res.files) == 3 |
110 | | - |
111 | 48 | @patch("shared.api_archive.archive.ArchiveService.read_chunks") |
112 | 49 | def test_build_report_from_commit(self, read_chunks_mock): |
113 | 50 | f = open(current_file.parent / "samples" / "chunks.txt", "r") |
|
0 commit comments