test-reporting 4.4.0__tar.gz → 4.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {test_reporting-4.4.0 → test_reporting-4.4.1}/PKG-INFO +1 -1
  2. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/monthly_ui.py +9 -1
  3. {test_reporting-4.4.0 → test_reporting-4.4.1}/setup.py +1 -1
  4. {test_reporting-4.4.0 → test_reporting-4.4.1}/test_reporting.egg-info/PKG-INFO +1 -1
  5. {test_reporting-4.4.0 → test_reporting-4.4.1}/tests/test_published_monthly_report.py +3 -0
  6. {test_reporting-4.4.0 → test_reporting-4.4.1}/LICENSE +0 -0
  7. {test_reporting-4.4.0 → test_reporting-4.4.1}/README.md +0 -0
  8. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/__init__.py +0 -0
  9. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/classifier.py +0 -0
  10. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/cli.py +0 -0
  11. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/config.py +0 -0
  12. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/exporters/__init__.py +0 -0
  13. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/exporters/pdf_exporter.py +0 -0
  14. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/exporters/pptx_exporter.py +0 -0
  15. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/exporters/xlsx_exporter.py +0 -0
  16. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/monthly_report.py +0 -0
  17. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/pdf_analysis.py +0 -0
  18. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/plugin.py +0 -0
  19. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/publisher.py +0 -0
  20. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/report_insights.py +0 -0
  21. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/run_source.py +0 -0
  22. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/storage.py +0 -0
  23. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/templates/index.html +0 -0
  24. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/templates/project.html +0 -0
  25. {test_reporting-4.4.0 → test_reporting-4.4.1}/reporting/templates/run.html +0 -0
  26. {test_reporting-4.4.0 → test_reporting-4.4.1}/setup.cfg +0 -0
  27. {test_reporting-4.4.0 → test_reporting-4.4.1}/test_reporting.egg-info/SOURCES.txt +0 -0
  28. {test_reporting-4.4.0 → test_reporting-4.4.1}/test_reporting.egg-info/dependency_links.txt +0 -0
  29. {test_reporting-4.4.0 → test_reporting-4.4.1}/test_reporting.egg-info/entry_points.txt +0 -0
  30. {test_reporting-4.4.0 → test_reporting-4.4.1}/test_reporting.egg-info/requires.txt +0 -0
  31. {test_reporting-4.4.0 → test_reporting-4.4.1}/test_reporting.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: test-reporting
3
- Version: 4.4.0
3
+ Version: 4.4.1
4
4
  Summary: Multi-project test reporting dashboard — collect results locally or push to S3
5
5
  Home-page: https://github.com/amahdy77/test-reporting.git
6
6
  Author: Ashfaqur Mahdy
@@ -3,6 +3,7 @@
3
3
  import html
4
4
  import io
5
5
  import json
6
+ import re
6
7
  import tempfile
7
8
  import webbrowser
8
9
  import zipfile
@@ -119,6 +120,12 @@ endInput.addEventListener('change', chooseCustom);
119
120
  </main></body></html>'''.encode('utf-8')
120
121
 
121
122
 
123
+ def _download_name(project, start, end):
124
+ """Build a safe, recognizable ZIP name for the browser download."""
125
+ project_part = re.sub(r'[^A-Za-z0-9._-]+', '-', project).strip('.-')[:60] or 'project'
126
+ return f'Test_Report_{project_part}_{start}_to_{end}.zip'
127
+
128
+
122
129
  def make_handler(config, run_source=None):
123
130
  source = run_source or PublishedRunSource(config)
124
131
 
@@ -179,7 +186,8 @@ def make_handler(config, run_source=None):
179
186
  body = output.getvalue()
180
187
  self.send_response(200)
181
188
  self.send_header('Content-Type', 'application/zip')
182
- self.send_header('Content-Disposition', 'attachment; filename="test-report.zip"')
189
+ self.send_header('Content-Disposition',
190
+ f'attachment; filename="{_download_name(project, start, end)}"')
183
191
  self.send_header('Content-Length', str(len(body)))
184
192
  self.send_header('X-Content-Type-Options', 'nosniff')
185
193
  self.end_headers()
@@ -9,7 +9,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
9
9
 
10
10
  setup(
11
11
  name='test-reporting',
12
- version='4.4.0',
12
+ version='4.4.1',
13
13
  description='Multi-project test reporting dashboard — collect results locally or push to S3',
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: test-reporting
3
- Version: 4.4.0
3
+ Version: 4.4.1
4
4
  Summary: Multi-project test reporting dashboard — collect results locally or push to S3
5
5
  Home-page: https://github.com/amahdy77/test-reporting.git
6
6
  Author: Ashfaqur Mahdy
@@ -170,6 +170,9 @@ class PublishedMonthlyReportTests(unittest.TestCase):
170
170
  'end': '2026-10-01', 'format': 'xlsx'}).encode()
171
171
  with urllib.request.urlopen(address + '/generate', data=good_form) as response:
172
172
  self.assertEqual(response.headers.get_content_type(), 'application/zip')
173
+ self.assertEqual(
174
+ response.headers['Content-Disposition'],
175
+ 'attachment; filename="Test_Report_Project-A_2026-10-01_to_2026-10-01.zip"')
173
176
  with zipfile.ZipFile(io.BytesIO(response.read())) as archive:
174
177
  self.assertEqual(len(archive.namelist()), 1)
175
178
  self.assertTrue(archive.namelist()[0].endswith('.xlsx'))
File without changes
File without changes
File without changes