SXXXXXXX_PyUCC/tests/test_countings.py
VALLONGOL 4fdd646d60 Chore: Stop tracking files based on .gitignore update.
Untracked files matching the following rules:
- Rule "*.zip": 1 file
2025-11-24 10:15:59 +01:00

35 lines
950 B
Python

import unittest
import tempfile
from pathlib import Path
from pyucc.core.countings_impl import analyze_file_counts
class TestCountings(unittest.TestCase):
def test_analyze_file_counts_basic(self):
content = """# comment line
print('hello')
# another comment
"""
with tempfile.NamedTemporaryFile("w", delete=False, suffix=".py") as tf:
tf.write(content)
tmpname = tf.name
p = Path(tmpname)
res = analyze_file_counts(p)
# Basic structure checks
self.assertIn("file", res)
self.assertIn("physical_lines", res)
self.assertIn("code_lines", res)
self.assertIn("blank_lines", res)
self.assertIn("language", res)
# Types
self.assertIsInstance(res["physical_lines"], int)
self.assertIsInstance(res["code_lines"], int)
self.assertIsInstance(res["blank_lines"], int)
if __name__ == '__main__':
unittest.main()