Skip to content

Commit

Permalink
Fix E2E tests - #148
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Oct 2, 2023
1 parent 361a8fe commit 4fc39a5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
20 changes: 20 additions & 0 deletions tests/Serval.E2ETests/MissingServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@ public void UseMissingEngineServerAsync()
Assert.That(ex!.StatusCode, Is.EqualTo(503));
}

[Test]
[Category("MultiSegmentUpload")]
[Category("ParatextProject")]
public async Task NmtLargeBatch()
{
await _helperClient!.ClearEngines();
string engineId = await _helperClient.CreateNewEngine("Nmt", "es", "en", "NMT3");
var books = new string[] { "bible_LARGEFILE.txt" };
await _helperClient.AddTextCorpusToEngine(engineId, books, "es", "en", false);
var cId = await _helperClient.AddTextCorpusToEngine(engineId, new string[] { "3JN.txt" }, "es", "en", true);
await _helperClient.BuildEngine(engineId);
await Task.Delay(1000);
IList<Pretranslation> lTrans = await _helperClient.translationEnginesClient.GetAllPretranslationsAsync(
engineId,
cId
);
TestContext.WriteLine(lTrans[0].Translation);
Assert.IsTrue(lTrans[0].Translation.Contains("beloved"));
}

[TearDown]
public void TearDown() { }
}
Expand Down
18 changes: 0 additions & 18 deletions tests/Serval.E2ETests/ServalApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,6 @@ public async Task NmtBatch()
Assert.IsTrue(lTrans[0].Translation.Contains("dearly beloved Gaius"));
}

[Test]
public async Task NmtLargeBatch()
{
await _helperClient!.ClearEngines();
string engineId = await _helperClient.CreateNewEngine("Nmt", "es", "en", "NMT3");
var books = new string[] { "bible_LARGEFILE.txt" };
await _helperClient.AddTextCorpusToEngine(engineId, books, "es", "en", false);
var cId = await _helperClient.AddTextCorpusToEngine(engineId, new string[] { "3JN.txt" }, "es", "en", true);
await _helperClient.BuildEngine(engineId);
await Task.Delay(1000);
IList<Pretranslation> lTrans = await _helperClient.translationEnginesClient.GetAllPretranslationsAsync(
engineId,
cId
);
TestContext.WriteLine(lTrans[0].Translation);
Assert.IsTrue(lTrans[0].Translation.Contains("beloved"));
}

[Test]
public async Task GetNmtCancelAndRestartBuild()
{
Expand Down

0 comments on commit 4fc39a5

Please sign in to comment.