Skip to content

Add unit tests for ComponentInstance module#598

Open
vipul-09 wants to merge 1 commit into
FOSSEE:masterfrom
vipul-09:pr-component-instance-tests-clean
Open

Add unit tests for ComponentInstance module#598
vipul-09 wants to merge 1 commit into
FOSSEE:masterfrom
vipul-09:pr-component-instance-tests-clean

Conversation

@vipul-09

Copy link
Copy Markdown

Related Issues

Improves test coverage for the schematic converter by adding automated unit tests for the ComponentInstance module. These tests verify component parsing and KiCad output generation, helping detect regressions during future development.

Purpose

The main objective is to improve the test coverage of the schematic converter by adding automated unit tests for the ComponentInstance module. These tests verify correct parsing of component information, default attribute generation, attribute handling, orientation handling, and generation of KiCad-compatible output.

Approach

Created a pytest-based test suite under:

unit_tests/test_component_instance.py

The following functionality is covered:

  • Parsing basic component properties
  • Default PKGREF attribute generation
  • Default VALUE attribute generation
  • Parsing PKGREF attribute
  • Parsing VALUE attribute
  • Parsing DC attribute
  • Parsing GAIN attribute
  • Verifying generated output from ComponentInstance.print()
  • Verifying component block generation
  • Verifying field headers
  • Verifying reference and value output
  • Verifying unit line generation
  • Verifying all supported orientations:
    • h
      
    • H
      
    • v
      
    • V
      
    • u
      
    • U
      
    • d
      
    • D
      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant