Fix TypeError in SPI/UART tests and correct frequency calculation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- embedded-iot, testing-qa
Research direction
Start with tests/test_spi.py and tests/test_uart.py, checking the PWM_FERQUENCY typo and the arithmetic using SPIMaster._frequency and UART._baudrate. Correct the constant and ensure the methods are called rather than using method objects, without hardcoding 1000. Run both test files and confirm the frequency calculations pass.
Written by the indexing model from the issue text.
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.
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fossasia/pslab-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fossasia/pslab-python#272 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
fossasia/pslab-python#257 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fossasia/pslab-python#285 ·
-
fossasia/pslab-python#280 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fossasia/pslab-python#273 · 4 comments ·
All issues in fossasia/pslab-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100