feat(ui): Enhanced context control with per-file flags and Gemini cache awareness
This commit is contained in:
39
tests/test_file_item_model.py
Normal file
39
tests/test_file_item_model.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import pytest
|
||||
from src.models import FileItem
|
||||
|
||||
def test_file_item_fields():
|
||||
"""Test that FileItem exists and has correct default values."""
|
||||
item = FileItem(path="src/models.py")
|
||||
assert item.path == "src/models.py"
|
||||
assert item.auto_aggregate is True
|
||||
assert item.force_full is False
|
||||
|
||||
def test_file_item_to_dict():
|
||||
"""Test that FileItem can be serialized to a dict."""
|
||||
item = FileItem(path="test.py", auto_aggregate=False, force_full=True)
|
||||
expected = {
|
||||
"path": "test.py",
|
||||
"auto_aggregate": False,
|
||||
"force_full": True
|
||||
}
|
||||
assert item.to_dict() == expected
|
||||
|
||||
def test_file_item_from_dict():
|
||||
"""Test that FileItem can be deserialized from a dict."""
|
||||
data = {
|
||||
"path": "test.py",
|
||||
"auto_aggregate": False,
|
||||
"force_full": True
|
||||
}
|
||||
item = FileItem.from_dict(data)
|
||||
assert item.path == "test.py"
|
||||
assert item.auto_aggregate is False
|
||||
assert item.force_full is True
|
||||
|
||||
def test_file_item_from_dict_defaults():
|
||||
"""Test that FileItem.from_dict handles missing fields."""
|
||||
data = {"path": "test.py"}
|
||||
item = FileItem.from_dict(data)
|
||||
assert item.path == "test.py"
|
||||
assert item.auto_aggregate is True
|
||||
assert item.force_full is False
|
||||
Reference in New Issue
Block a user