Fix tests

This commit is contained in:
Timothy Baldridge 2020-05-20 16:36:29 -06:00
parent 78b09df334
commit b5c01958dc
4 changed files with 13 additions and 13 deletions

View File

@ -189,17 +189,17 @@ namespace Wabbajack.BuildServer.Test
}
protected async Task<Uri> MakeModList()
protected async Task<Uri> 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",

View File

@ -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<SqlService>();
var downloader = Fixture.GetService<ModListDownloader>();
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

View File

@ -32,7 +32,7 @@ namespace Wabbajack.Server.Test
{
var validator = Fixture.GetService<ListValidator>();
var nonNexus = Fixture.GetService<NonNexusDownloadValidator>();
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();

View File

@ -99,7 +99,7 @@ namespace Wabbajack.BuildServer.Controllers
private async Task<FtpClient> GetBunnyCdnFtpClient()
{
var info = Utils.FromEncryptedJson<BunnyCdnFtpInfo>("bunny-cdn-patch-ftp-info");
var info = Utils.FromEncryptedJson<BunnyCdnFtpInfo>("bunny-cdn-ftp-info");
var client = new FtpClient(info.Hostname) {Credentials = new NetworkCredential(info.Username, info.Password)};
await client.ConnectAsync();
return client;