From d0801d1e5df9c2a91928e128935abdb737006861 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 3 Jan 2022 12:55:26 -0300 Subject: [PATCH] Fixed test_qr_lib_1 - Problems when running without X - KiCad 5 vs 6 details --- tests/test_plot/test_misc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 84376d84..f220d384 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -954,12 +954,14 @@ def test_qr_lib_1(test_dir): cmd = ['zbarimg', ctx.get_out_path('0.png')] res = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode() logging.debug(res.split('\n')[0]) - assert res.startswith('QR-Code:QR Test A') + assert 'QR-Code:QR Test A' in res cmd = ['zbarimg', ctx.get_out_path('1.png')] res = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode() logging.debug(res.split('\n')[0]) - assert res.startswith('QR-Code:https://github.com/INTI-CMNB/KiBot/') + assert 'QR-Code:https://github.com/INTI-CMNB/KiBot/' in res bd = ctx.get_board_dir() files = ['qr.lib', 'qr.kicad_sym', 'qr.pretty/QR.kicad_mod', 'qr.pretty/QR2.kicad_mod'] for f in files: - shutil.copy2(os.path.join(bd, 'qr_test/'+f+'.bogus'), os.path.join(bd, 'qr_test/'+f)) + bogus = os.path.join(bd, 'qr_test/'+f+'.bogus') + if os.path.isfile(bogus): + shutil.copy2(bogus, os.path.join(bd, 'qr_test/'+f))