KaykCaputo / KaykCaputo/OpenCifra

Add unit tests for core functionality

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue testing
Dominant language
Python
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Description
The project currently lacks automated tests. Adding unit tests would improve code reliability and make future refactoring safer.

## Scope
Prioritize testing for these functions:
1. `normalize()` - Text normalization with accents and special characters
2. `parse_cifra_html()` - HTML parsing and chord markup conversion
3. URL generation logic in `fetch_song()`

## Suggested Framework
- `pytest` - Modern Python testing framework
- `pytest-cov` - Code coverage reporting

## Example Test Structure
```python
# test_main.py
import pytest
from main import OpenCifraApp

def test_normalize_accents():
app = OpenCifraApp()
assert app.normalize("João") == "joao"
assert app.normalize("Música") == "musica"

def test_normalize_special_chars():
app = OpenCifraApp()
assert app.normalize("Rock & Roll!") == "rock & roll"
```

## Additional Considerations
- Add GitHub Actions workflow for CI
- Set target coverage threshold (e.g., 70%)
- Document testing setup in README

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.