Skip to content

Commit

Permalink
[Tests][Added] -L
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Jan 9, 2024
1 parent 957968f commit 7ce44d7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/test_plot/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1549,15 +1549,17 @@ def test_diff_git_5(test_dir):
@pytest.mark.eeschema
def test_diff_file_sch_1(test_dir):
""" Difference between the current Schematic and a reference file
Also test definitions (from CLI and env) """
Also test definitions (from CLI and env)
Also log file """
prj = 'light_control_diff'
yaml = 'diff_file_sch'
ctx = context.TestContext(test_dir, prj, yaml)
os.environ['SCHExt'] = context.KICAD_SCH_EXT
ctx.run(extra=['-E', 'KiVer='+str(context.kicad_major), '--defs-from-env'])
ctx.run(extra=['-E', 'KiVer='+str(context.kicad_major), '--defs-from-env', '-L', ctx.get_out_path('log')])
ctx.expect_out_file(prj+'-diff_sch_FILE-Current.pdf')
if is_debian:
ctx.compare_pdf(prj+'-diff_sch.pdf')
ctx.expect_out_file('log')
ctx.clean_up(keep_project=True)


Expand Down Expand Up @@ -1659,13 +1661,21 @@ def test_lcsc_field_unknown(test_dir):

@pytest.mark.skipif(context.ki5(), reason="Needs porting")
def test_lcsc_field_specified(test_dir):
""" Test we select the field """
""" Test we select the field
Also log to existing file """
prj = 'lcsc_field_unknown'
ctx = context.TestContextSCH(test_dir, prj, 'lcsc_field_specified', 'JLCPCB')
ctx.run(extra=['_JLCPCB_bom'])
log_file = ctx.get_out_path('log')
with open(log_file, 'w') as f:
f.write('already there')
ctx.run(extra=['-L', log_file, '_JLCPCB_bom'])
assert ctx.search_err('User selected.*Cryptic')
r, _, _ = ctx.load_csv(prj+'_bom_jlc.csv')
assert r[0][3] == 'C1234'
ctx.expect_out_file('log')
with open(log_file) as f:
v = f.read()
assert not v.startswith('already')


@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+")
Expand Down

0 comments on commit 7ce44d7

Please sign in to comment.