Skip to content

Commit 102ebfe

Browse files
authored
Merge pull request pklaus#10 from DL6ER/more-tests
Add further tests
2 parents 77bfa2b + 4693f23 commit 102ebfe

22 files changed

Lines changed: 102 additions & 13 deletions

app/labeldesigner/label.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,7 @@ def _draw_text(self, img = None, bboxes = [], text_offset = (0, 0)):
417417
anchor = "rt"
418418
# else: error
419419
else:
420-
logger.error(f"Unsupported alignment: {align}")
421-
return
420+
raise ValueError(f"Unsupported alignment: {align}")
422421

423422
if do_draw and 'font_inverted' in line and line['font_inverted']:
424423
# Draw a filled rectangle

app/labeldesigner/routes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ def print_label():
117117
printer = create_printer_from_request(request)
118118
label = create_label_from_request(request)
119119
print_count = int(request.values.get('print_count', 1))
120+
if print_count < 1:
121+
raise ValueError("print_count must be greater than 0")
120122
cut_once = int(request.values.get('cut_once', 0)) == 1
121123
except Exception as e:
122124
return_dict['message'] = str(e)

tests/extra_fields_ignored.png

751 Bytes
Loading
File renamed without changes.

0 commit comments

Comments
 (0)