[Tests][Import][Filters][Variants][Added] basic tests

This commit is contained in:
Salvador E. Tropea 2024-01-19 09:30:01 -03:00
parent 9c1396e14c
commit 95fd5cf28e
3 changed files with 29 additions and 18 deletions

View File

@ -228,6 +228,8 @@ def test_position_variant_t2i(test_dir):
def test_position_rot_1(test_dir):
""" Rotation filter inside a variant.
Also testing the import mechanism for them """
prj = 'light_control'
ctx = context.TestContext(test_dir, prj, 'simple_position_rot_1', POS_DIR)
ctx.run()
@ -235,6 +237,8 @@ def test_position_rot_1(test_dir):
ctx.expect_out_file(output)
ctx.compare_txt(output)
ctx.compare_txt(prj+'_bom_jlc.csv')
ctx.search_err(r"can't import `foobar` filter")
ctx.search_err(r"can't import `foobar` variant")
ctx.clean_up(keep_project=True)

View File

@ -0,0 +1,21 @@
kibot:
version: 1
filters:
- name: fix_rotation
comment: 'Adjust rotation for JLC'
type: rot_footprint
- name: only_jlc_parts
comment: 'Only parts with JLC code'
type: generic
include_only:
- column: 'LCSC#'
regex: '^C\d+'
variants:
- name: rotated
comment: 'Just a place holder for the rotation filter'
type: kibom
variant: rotated
pre_transform: fix_rotation

View File

@ -1,24 +1,10 @@
kibot:
version: 1
filters:
- name: fix_rotation
comment: 'Adjust rotation for JLC'
type: rot_footprint
- name: only_jlc_parts
comment: 'Only parts with JLC code'
type: generic
include_only:
- column: 'LCSC#'
regex: '^C\d+'
variants:
- name: rotated
comment: 'Just a place holder for the rotation filter'
type: kibom
variant: rotated
pre_transform: fix_rotation
import:
- file: rotation_filter_and_variant.kibot.yaml
filters: ['fix_rotation', 'only_jlc_parts', 'foobar']
variants: ['rotated', 'foobar']
outputs:
- name: 'position'