From b5c01958dc91647ce089ef519a38b7af7cbbc47f Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Wed, 20 May 2020 16:36:29 -0600 Subject: [PATCH] Fix tests --- Wabbajack.Server.Test/ABuildServerSystemTest.cs | 6 +++--- Wabbajack.Server.Test/ModListValidationTests.cs | 14 +++++++------- Wabbajack.Server.Test/ModlistUpdater.cs | 4 ++-- Wabbajack.Server/Controllers/AuthoredFiles.cs | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Wabbajack.Server.Test/ABuildServerSystemTest.cs b/Wabbajack.Server.Test/ABuildServerSystemTest.cs index 101184bf..eaaf9838 100644 --- a/Wabbajack.Server.Test/ABuildServerSystemTest.cs +++ b/Wabbajack.Server.Test/ABuildServerSystemTest.cs @@ -189,17 +189,17 @@ namespace Wabbajack.BuildServer.Test } - protected async Task MakeModList() + protected async Task MakeModList(string modFileName) { var archive_data = Encoding.UTF8.GetBytes("Cheese for Everyone!"); - var test_archive_path = "test_archive.txt".RelativeTo(Fixture.ServerPublicFolder); + var test_archive_path = modFileName.RelativeTo(Fixture.ServerPublicFolder); await test_archive_path.WriteAllBytesAsync(archive_data); ModListData = new ModList(); ModListData.Archives.Add( - new Archive(new HTTPDownloader.State(MakeURL("test_archive.txt"))) + new Archive(new HTTPDownloader.State(MakeURL(modFileName.ToString()))) { Hash = await test_archive_path.FileHashAsync(), Name = "test_archive", diff --git a/Wabbajack.Server.Test/ModListValidationTests.cs b/Wabbajack.Server.Test/ModListValidationTests.cs index f3e34f8d..0396a632 100644 --- a/Wabbajack.Server.Test/ModListValidationTests.cs +++ b/Wabbajack.Server.Test/ModListValidationTests.cs @@ -25,7 +25,7 @@ namespace Wabbajack.BuildServer.Test [Fact] public async Task CanLoadMetadataFromTestServer() { - var modlist = await MakeModList(); + var modlist = await MakeModList("CanLoadMetadataFromTestServer.txt"); Consts.ModlistMetadataURL = modlist.ToString(); var data = await ModlistMetadata.LoadFromGithub(); Assert.Equal(2, data.Count); @@ -35,11 +35,11 @@ namespace Wabbajack.BuildServer.Test [Fact] public async Task CanIngestModLists() { - var modlist = await MakeModList(); + var modlist = await MakeModList("CanIngestModLists.txt"); Consts.ModlistMetadataURL = modlist.ToString(); var sql = Fixture.GetService(); var downloader = Fixture.GetService(); - Assert.Equal(2, await downloader.CheckForNewLists()); + await downloader.CheckForNewLists(); foreach (var list in ModListMetaData) { @@ -54,7 +54,7 @@ namespace Wabbajack.BuildServer.Test [Fact] public async Task CanValidateModLists() { - var modlists = await MakeModList(); + var modlists = await MakeModList("can_validate_file.txt"); Consts.ModlistMetadataURL = modlists.ToString(); Utils.Log("Updating modlists"); await RevalidateLists(true); @@ -68,7 +68,7 @@ namespace Wabbajack.BuildServer.Test await CheckListFeeds(0, 1); Utils.Log("Break List"); - var archive = "test_archive.txt".RelativeTo(Fixture.ServerPublicFolder); + var archive = "can_validate_file.txt".RelativeTo(Fixture.ServerPublicFolder); await archive.MoveToAsync(archive.WithExtension(new Extension(".moved")), true); // We can revalidate but the non-nexus archives won't be checked yet since the list didn't change @@ -106,7 +106,7 @@ namespace Wabbajack.BuildServer.Test [Fact] public async Task CanHealLists() { - var modlists = await MakeModList(); + var modlists = await MakeModList("CanHealLists.txt"); Consts.ModlistMetadataURL = modlists.ToString(); Utils.Log("Updating modlists"); await RevalidateLists(true); @@ -120,7 +120,7 @@ namespace Wabbajack.BuildServer.Test await CheckListFeeds(0, 1); Utils.Log("Break List by changing the file"); - var archive = "test_archive.txt".RelativeTo(Fixture.ServerPublicFolder); + var archive = "CanHealLists.txt".RelativeTo(Fixture.ServerPublicFolder); await archive.WriteAllTextAsync("broken"); // We can revalidate but the non-nexus archives won't be checked yet since the list didn't change diff --git a/Wabbajack.Server.Test/ModlistUpdater.cs b/Wabbajack.Server.Test/ModlistUpdater.cs index 6a85d9cb..add77a6c 100644 --- a/Wabbajack.Server.Test/ModlistUpdater.cs +++ b/Wabbajack.Server.Test/ModlistUpdater.cs @@ -32,7 +32,7 @@ namespace Wabbajack.Server.Test { var validator = Fixture.GetService(); var nonNexus = Fixture.GetService(); - var modLists = await MakeModList(); + var modLists = await MakeModList("CanIndexAndUpdateFiles.txt"); Consts.ModlistMetadataURL = modLists.ToString(); @@ -79,7 +79,7 @@ namespace Wabbajack.Server.Test [Fact] public async Task TestEndToEndArchiveUpdating() { - var modLists = await MakeModList(); + var modLists = await MakeModList("TestEndToEndArchiveUpdating.txt"); Consts.ModlistMetadataURL = modLists.ToString(); diff --git a/Wabbajack.Server/Controllers/AuthoredFiles.cs b/Wabbajack.Server/Controllers/AuthoredFiles.cs index 5ca8eaf2..b4197485 100644 --- a/Wabbajack.Server/Controllers/AuthoredFiles.cs +++ b/Wabbajack.Server/Controllers/AuthoredFiles.cs @@ -99,7 +99,7 @@ namespace Wabbajack.BuildServer.Controllers private async Task GetBunnyCdnFtpClient() { - var info = Utils.FromEncryptedJson("bunny-cdn-patch-ftp-info"); + var info = Utils.FromEncryptedJson("bunny-cdn-ftp-info"); var client = new FtpClient(info.Hostname) {Credentials = new NetworkCredential(info.Username, info.Password)}; await client.ConnectAsync(); return client;