Skip to content

Commit 5d57843

Browse files
committed
Dedent
1 parent af2f00d commit 5d57843

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

tests/test_manually.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,26 @@ def append_img(x, y) -> None:
6868
objects.append(IMAGES.format(filename=x, name=y))
6969

7070
options = {}
71-
if True:
72-
bcode = get_barcode(codename, code)
71+
bcode = get_barcode(codename, code)
72+
if codename.startswith("i"):
73+
options["center_text"] = False
74+
else:
75+
options["center_text"] = True
76+
filename = bcode.save(os.path.join(TESTPATH, codename), options=options)
77+
print(f"Code: {bcode.name}, Input: {code}, Output: {bcode.get_fullcode()}")
78+
append(os.path.basename(filename), bcode.name)
79+
if ImageWriter is not None:
80+
bcodec = get_barcode_class(codename)
81+
bcode = bcodec(code, writer=ImageWriter())
82+
opts = {}
7383
if codename.startswith("i"):
74-
options["center_text"] = False
84+
opts["center_text"] = False
7585
else:
76-
options["center_text"] = True
77-
filename = bcode.save(os.path.join(TESTPATH, codename), options=options)
78-
print(f"Code: {bcode.name}, Input: {code}, Output: {bcode.get_fullcode()}")
79-
append(os.path.basename(filename), bcode.name)
80-
if ImageWriter is not None:
81-
bcodec = get_barcode_class(codename)
82-
bcode = bcodec(code, writer=ImageWriter())
83-
opts = {}
84-
if codename.startswith("i"):
85-
opts["center_text"] = False
86-
else:
87-
opts["center_text"] = True
88-
filename = bcode.save(os.path.join(TESTPATH, codename), options=opts)
89-
append_img(os.path.basename(filename), bcode.name)
90-
else:
91-
objects.append(NO_PIL)
86+
opts["center_text"] = True
87+
filename = bcode.save(os.path.join(TESTPATH, codename), options=opts)
88+
append_img(os.path.basename(filename), bcode.name)
89+
else:
90+
objects.append(NO_PIL)
9291

9392

9493
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)