16 lines
469 B
Python
16 lines
469 B
Python
from pathlib import Path
|
|
from pyucc.core import countings
|
|
|
|
|
|
def test_countings_analyze_file_and_paths(tmp_path):
|
|
f = tmp_path / 'a.txt'
|
|
f.write_text('1\n\n3\n')
|
|
res = countings.analyze_file_counts(f)
|
|
assert res['physical_lines'] == 3
|
|
assert res['blank_lines'] == 1
|
|
assert res['code_lines'] == 2
|
|
|
|
out = countings.analyze_paths([f, tmp_path / 'missing.txt'])
|
|
assert isinstance(out, list)
|
|
assert 'error' in out[1] or out[1].get('file')
|