forked from obra/kicad-automation-scripts
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2022 Salvador E. Tropea | ||
# Copyright (c) 2022 Instituto Nacional de Tecnologïa Industrial | ||
# License: Apache 2.0 | ||
# Project: KiAuto (formerly kicad-automation-scripts) | ||
""" | ||
Tests for kicad2step | ||
For debug information use: | ||
pytest-3 --log-cli-level debug | ||
""" | ||
|
||
import os | ||
import sys | ||
import logging | ||
# Look for the 'utils' module from where the script is running | ||
script_dir = os.path.dirname(os.path.abspath(__file__)) | ||
prev_dir = os.path.dirname(script_dir) | ||
sys.path.insert(0, prev_dir) | ||
# Utils import | ||
from utils import context | ||
sys.path.insert(0, os.path.dirname(prev_dir)) | ||
from kiauto.misc import (PCBNEW_CFG_PRESENT, NO_PCB, WRONG_PCB_NAME, WRONG_ARGUMENTS, CORRUPTED_PCB) | ||
|
||
PROG = 'kicad2step_do' | ||
|
||
|
||
def test_kicad2step_1(test_dir): | ||
fname = 'good.step' | ||
fdir = os.path.join(test_dir, 'STEP_1') | ||
ctx = context.TestContext(test_dir, 'STEP_1', 'good-project') | ||
os.environ['KIPRJMOD'] = os.path.dirname(ctx.board_file) | ||
cmd = [PROG, '-vvv', '-o', fname, '-d', fdir, '--subst-models'] | ||
ffname = os.path.join(fdir, fname) | ||
if os.path.isfile(ffname): | ||
os.remove(ffname) | ||
ctx.run(cmd, no_dir=True) | ||
del os.environ['KIPRJMOD'] | ||
ctx.expect_out_file(fname) | ||
ctx.clean_up() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters