fix: 96 DPI is accepted as the Site shows it; big carts upload 4 at a time (Sentry 12/11)
The server compared the raw lowest resolution (95,6) with 96 but printed it rounded, refusing '96 DPI abaixo do mínimo de 96'; it now decides on the same rounded value the Site shows. A big cart started every upload at once and hit the limit of 10 pending uploads (429): the limit is 30, that refusal carries Retry-After so the Site retries by itself, and the Site runs at most 4 uploads at a time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,20 @@ class GradeCheckTests(unittest.TestCase):
|
||||
for dpi in (200, 287, 293):
|
||||
self.assertIsNone(issue(dpi), dpi)
|
||||
self.assertEqual(grade_check.grade_of(dpi), 100)
|
||||
# The Site shows the rounded DPI: 95.6 is 96 and passes; 95.4 is 95
|
||||
# and is refused. The warning band starts at the shown 199.
|
||||
width_px = lambda dpi: round(dpi * 57 / 2.54)
|
||||
for dpi in (95.6, 95.4, 199.6, 199.4):
|
||||
files.blobs[f'{dpi}.png'] = encoded('PNG', (width_px(dpi), 20))
|
||||
rows[f'{dpi}.png'] = {'name': f'{dpi}.png', 'size': 1}
|
||||
# 95.6 is shown as 96: the warning band, not the refusal; acknowledged,
|
||||
# it goes through. 95.4 is shown as 95 and refused.
|
||||
self.assertNotIn('abaixo do mínimo', issue(95.6))
|
||||
self.assertIn('confirme a ressalva', issue(95.6))
|
||||
self.assertIsNone(issue(95.6, 'warning', True))
|
||||
self.assertIn('95 DPI', issue(95.4))
|
||||
self.assertIsNone(issue(199.6))
|
||||
self.assertIn('confirme a ressalva', issue(199.4))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user