mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix a few tests
This commit is contained in:
@ -295,16 +295,9 @@ namespace Wabbajack.Common
|
|||||||
File.AppendAllText(_path, text);
|
File.AppendAllText(_path, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyTo(AbsolutePath dest, bool useMove = false)
|
public void CopyTo(AbsolutePath dest)
|
||||||
{
|
{
|
||||||
if (useMove)
|
File.Copy(_path, dest._path);
|
||||||
{
|
|
||||||
File.Move(_path, dest._path, MoveOptions.ReplaceExisting);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
File.Copy(_path, dest._path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<string>> ReadAllLinesAsync()
|
public async Task<IEnumerable<string>> ReadAllLinesAsync()
|
||||||
|
@ -57,14 +57,12 @@ namespace Wabbajack.Lib.Downloaders
|
|||||||
|
|
||||||
if (general.modID != null && general.fileID != null && general.gameName != null)
|
if (general.modID != null && general.fileID != null && general.gameName != null)
|
||||||
{
|
{
|
||||||
var name = (string)general.gameName;
|
var game = GameRegistry.GetByFuzzyName((string)general.gameName).Game;
|
||||||
var gameMeta = GameRegistry.GetByMO2ArchiveName(name);
|
|
||||||
var game = gameMeta != null ? GameRegistry.GetByMO2ArchiveName(name).Game : GameRegistry.GetByNexusName(name).Game;
|
|
||||||
var client = await NexusApiClient.Get();
|
var client = await NexusApiClient.Get();
|
||||||
dynamic info;
|
ModInfo info;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
info = await client.GetModInfo(game, general.modID);
|
info = await client.GetModInfo(game, long.Parse((string)general.modID));
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
@ -469,7 +469,7 @@ namespace Wabbajack.Test
|
|||||||
|
|
||||||
using var tempFile = new TempFile();
|
using var tempFile = new TempFile();
|
||||||
await converted.Download(new Archive {Name = "yt_test.zip"}, tempFile.Path);
|
await converted.Download(new Archive {Name = "yt_test.zip"}, tempFile.Path);
|
||||||
Assert.Equal(Hash.FromBase64("H166oHG0wpY="), await tempFile.Path.FileHashAsync());
|
Assert.Equal(Hash.FromBase64("kD36zbA2X9Q="), await tempFile.Path.FileHashAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user