test: remove unused tests for stale file cleanup in Python tools syncing (#327)
parent
85cc93f33c
commit
dbdaa76d75
|
|
@ -147,31 +147,6 @@ namespace MCPForUnityTests.Editor.Data
|
||||||
Assert.Greater(_asset.fileStates[0].lastSyncTime, firstTime, "Should update sync time");
|
Assert.Greater(_asset.fileStates[0].lastSyncTime, firstTime, "Should update sync time");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void CleanupStaleStates_RemovesStatesForRemovedFiles()
|
|
||||||
{
|
|
||||||
var file1 = new TextAsset("print('test1')");
|
|
||||||
var file2 = new TextAsset("print('test2')");
|
|
||||||
|
|
||||||
// Add both files
|
|
||||||
_asset.pythonFiles.Add(file1);
|
|
||||||
_asset.pythonFiles.Add(file2);
|
|
||||||
|
|
||||||
// Record sync for both
|
|
||||||
_asset.RecordSync(file1, "hash1");
|
|
||||||
_asset.RecordSync(file2, "hash2");
|
|
||||||
|
|
||||||
Assert.AreEqual(2, _asset.fileStates.Count, "Should have two states");
|
|
||||||
|
|
||||||
// Remove one file
|
|
||||||
_asset.pythonFiles.Remove(file1);
|
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
_asset.CleanupStaleStates();
|
|
||||||
|
|
||||||
Assert.AreEqual(1, _asset.fileStates.Count, "Should have one state after cleanup");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void CleanupStaleStates_KeepsStatesForCurrentFiles()
|
public void CleanupStaleStates_KeepsStatesForCurrentFiles()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -59,22 +59,6 @@ namespace MCPForUnityTests.Editor.Services
|
||||||
Assert.AreEqual(0, result.ErrorCount, "Should not have errors");
|
Assert.AreEqual(0, result.ErrorCount, "Should not have errors");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void SyncProjectTools_CleansUpStaleFiles()
|
|
||||||
{
|
|
||||||
// Create a stale file in the destination
|
|
||||||
Directory.CreateDirectory(_testToolsDir);
|
|
||||||
string staleFile = Path.Combine(_testToolsDir, "old_tool.py");
|
|
||||||
File.WriteAllText(staleFile, "print('old')");
|
|
||||||
|
|
||||||
Assert.IsTrue(File.Exists(staleFile), "Stale file should exist before sync");
|
|
||||||
|
|
||||||
// Sync with no assets (should cleanup the stale file)
|
|
||||||
_service.SyncProjectTools(_testToolsDir);
|
|
||||||
|
|
||||||
Assert.IsFalse(File.Exists(staleFile), "Stale file should be removed after sync");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void SyncProjectTools_ReportsCorrectCounts()
|
public void SyncProjectTools_ReportsCorrectCounts()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue