mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-04 07:12:01 +00:00
Moved temporary files into a folder of their own below the data directory (#1245)
This commit is contained in:
1 parent
ddfc632b63
commit
12d3e1ec6c
52 files changed
+1219
-396
No files matched your search
@@ -74,27 +74,30 @@ public sealed class BflRecordingTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ATranscriptWaitsInAFolderOfItsOwnBelowTheStaging()
|
||||
public async Task ATranscriptWaitsInAFolderOfItsOwnInTheTemporaryFolder()
|
||||
{
|
||||
var first = new BflTranscriptLocation(this.dataDirectory);
|
||||
var second = new BflTranscriptLocation(this.dataDirectory);
|
||||
var first = new BflTranscriptLocation();
|
||||
var second = new BflTranscriptLocation();
|
||||
|
||||
var slot = await first.ResolveAsync("/Users/person/Interview.mp3", CancellationToken.None);
|
||||
var stagingDirectory = Path.Combine(this.dataDirectory, "media-staging");
|
||||
var temporaryFolder = Path.Join(TestHost.DATA_DIRECTORY, "tmp");
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(Path.GetDirectoryName(slot.Path), Is.EqualTo(first.FolderPath));
|
||||
Assert.That(Path.GetDirectoryName(first.FolderPath), Is.EqualTo(stagingDirectory), "The cleanup at the start of AI Studio removes only what lies below the staging.");
|
||||
Assert.That(Path.GetDirectoryName(first.FolderPath), Is.EqualTo(temporaryFolder), "AI Studio empties only its temporary folder when it starts.");
|
||||
Assert.That(second.FolderPath, Is.Not.EqualTo(first.FolderPath), "Two imports would share one transcript.");
|
||||
Assert.That(slot.Path, Does.Not.Contain("Interview"), "The folder of the person decides nothing in the data directory.");
|
||||
}
|
||||
|
||||
first.TryDelete();
|
||||
second.TryDelete();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task DeletingTheLocationRemovesTheTranscript()
|
||||
{
|
||||
var location = new BflTranscriptLocation(this.dataDirectory);
|
||||
var location = new BflTranscriptLocation();
|
||||
var slot = await location.ResolveAsync("/Users/person/Interview.mp3", CancellationToken.None);
|
||||
Directory.CreateDirectory(location.FolderPath);
|
||||
await File.WriteAllTextAsync(slot.Path, "Guten Tag.");
|
||||
@@ -103,7 +106,7 @@ public sealed class BflRecordingTests
|
||||
{
|
||||
Assert.That(location.TryDelete(), Is.True);
|
||||
Assert.That(Directory.Exists(location.FolderPath), Is.False);
|
||||
Assert.That(new BflTranscriptLocation(this.dataDirectory).TryDelete(), Is.True, "A location without a transcript is no failure.");
|
||||
Assert.That(new BflTranscriptLocation().TryDelete(), Is.True, "A location without a transcript is no failure.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user