Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

test(boot): the not-found test removes its staged site even when it fails

eyalgolaneb7629c9a14a
diff --git a/unity/Assets/Tests/EditMode/GameInputsTests.cs b/unity/Assets/Tests/EditMode/GameInputsTests.cs
index 71a79b9c3..15c4ac732 100644
--- a/unity/Assets/Tests/EditMode/GameInputsTests.cs
+++ b/unity/Assets/Tests/EditMode/GameInputsTests.cs
@@ -255,15 +255,18 @@ public class GameInputsTests
{
var site = StagedSite();
File.Delete(Path.Combine(site, "content", "people.yaml"));
- using (var server = new FlakySite(site, new Dictionary<string, (string, int)>()))
+ try
{
- var fetch = GameInputs.FetchAsync(server.BaseUrl).GetAwaiter();
- yield return Await(fetch);
- StringAssert.StartsWith("people.yaml: ", Assert.Throws<IOException>(() => fetch.GetResult()).Message);
- Assert.AreEqual(1, server.Hits("content/people.yaml"));
- Assert.AreEqual(0, GameInputs.OpenRequests);
+ using (var server = new FlakySite(site, new Dictionary<string, (string, int)>()))
+ {
+ var fetch = GameInputs.FetchAsync(server.BaseUrl).GetAwaiter();
+ yield return Await(fetch);
+ StringAssert.StartsWith("people.yaml: ", Assert.Throws<IOException>(() => fetch.GetResult()).Message);
+ Assert.AreEqual(1, server.Hits("content/people.yaml"));
+ Assert.AreEqual(0, GameInputs.OpenRequests);
+ }
}
- Directory.Delete(site, true);
+ finally { Directory.Delete(site, true); }
}
[Test]