Skip to content

Commit ed03cdf

Browse files
authored
Remove tests for build_report (#1222)
1 parent b3ecf04 commit ed03cdf

File tree

1 file changed

+2
-65
lines changed

1 file changed

+2
-65
lines changed

services/tests/test_report.py

+2-65
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
CommitFactory,
77
CommitWithReportFactory,
88
)
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
1310
from shared.reports.resources import Report, ReportFile
1411
from shared.reports.types import ReportLine
1512
from shared.storage.exceptions import FileNotInStorageError
1613
from shared.utils.sessions import Session
1714

1815
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
2217

2318
current_file = Path(__file__)
2419

@@ -50,64 +45,6 @@ def sorted_files(report: Report) -> list[ReportFile]:
5045

5146

5247
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-
11148
@patch("shared.api_archive.archive.ArchiveService.read_chunks")
11249
def test_build_report_from_commit(self, read_chunks_mock):
11350
f = open(current_file.parent / "samples" / "chunks.txt", "r")

0 commit comments

Comments
 (0)