fossasia / fossasia/pslab-python

Fix TypeError in SPI/UART tests and correct frequency calculation

Open
#270 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.6k
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Description The current tests in tests/test_spi.py and tests/test_uart.py have two issues:

A typo in the constant name PWM_FERQUENCY.

A TypeError caused by attempting to perform arithmetic operations directly on the SPIMaster._frequency and UART._baudrate methods without calling them.

Proposed Solution

Rename the constant to PWM_FREQUENCY.

Fix the logic to correctly call the methods (e.g., SPIMaster._frequency()) to retrieve the integer value instead of using the method object itself.

Avoid hardcoding the frequency to 1000 to ensure tests remain meaningful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.