mirror of
https://github.com/rzmk/czv.git
synced 2025-12-19 08:09:24 +00:00
refactor: use czv in czv-python
- Add `file_path` for czv-python count operations - Refactor tests based on file path instead of data - Use thiserror in czv - Update examples to reflect changes
This commit is contained in:
parent
9799ab694b
commit
ce260e9491
14 changed files with 79 additions and 55 deletions
|
|
@ -10,7 +10,7 @@ class TestCountFunc:
|
|||
def test_count(self, file_name, expected):
|
||||
"""Count the total number of non-header rows."""
|
||||
|
||||
result = czv.row_count(test_data[file_name].read_text())
|
||||
result = czv.row_count(file_path=test_data[file_name])
|
||||
assert result == expected
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
@ -20,5 +20,5 @@ class TestCountFunc:
|
|||
def test_include_header_row(self, file_name, expected):
|
||||
"""Count the total number of rows including the header row."""
|
||||
|
||||
result = czv.row_count(test_data[file_name].read_text(), include_header_row=True)
|
||||
result = czv.row_count(file_path=test_data[file_name], include_header_row=True)
|
||||
assert result == expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue