Skip to content

Commit

Permalink
Add pretranslation filtering to E2E test (would not catch it).
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Oct 16, 2024
1 parent bdf43fa commit f57adfe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Serval/test/Serval.E2ETests/ServalApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,21 @@ public async Task NmtBatch()
string[] books = ["MAT.txt", "1JN.txt", "2JN.txt"];
string cId1 = await _helperClient.AddTextCorpusToEngineAsync(engineId, books, "es", "en", false);
_helperClient.TranslationBuildConfig.TrainOn = [new() { CorpusId = cId1, TextIds = ["1JN.txt"] }];
string cId2 = await _helperClient.AddTextCorpusToEngineAsync(engineId, ["3JN.txt"], "es", "en", true);
string cId2 = await _helperClient.AddTextCorpusToEngineAsync(
engineId,
["2JN.txt", "3JN.txt"],
"es",
"en",
true
);
_helperClient.TranslationBuildConfig.Pretranslate = [new() { CorpusId = cId2, TextIds = ["2JN.txt"] }];
await _helperClient.BuildEngineAsync(engineId);
await Task.Delay(1000);
IList<Pretranslation> lTrans = await _helperClient.TranslationEnginesClient.GetAllPretranslationsAsync(
engineId,
cId2
);
Assert.That(lTrans, Has.Count.EqualTo(14));
Assert.That(lTrans, Has.Count.EqualTo(13)); // just 2 John
}

[Test]
Expand Down

0 comments on commit f57adfe

Please sign in to comment.