mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-31 04:04:57 -06:00
added copy file tests
This commit is contained in:
@@ -88,6 +88,7 @@ namespace FileFlows.BasicNodes.File
|
||||
args.Logger.ILog($"CopyFile.Dest[6] '{dest}'");
|
||||
|
||||
args.Logger.ILog($"CopyFileArgs: '{args.WorkingFile}', '{dest}'");
|
||||
|
||||
bool copied = args.CopyFile(args.WorkingFile, dest, updateWorkingFile: true);
|
||||
if (!copied)
|
||||
return -1;
|
||||
|
||||
31
BasicNodes/Tests/CopyTests.cs
Normal file
31
BasicNodes/Tests/CopyTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using FileFlows.Plugin;
|
||||
|
||||
#if(DEBUG)
|
||||
|
||||
namespace BasicNodes.Tests;
|
||||
|
||||
using FileFlows.BasicNodes.File;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
public class CopyTests
|
||||
{
|
||||
|
||||
[TestMethod]
|
||||
public void CopyTests_Dir_Mapping()
|
||||
{
|
||||
var logger = new TestLogger();
|
||||
var args = new FileFlows.Plugin.NodeParameters(@"c:\test\testfile.mkv", logger, false, string.Empty);
|
||||
args.PathMapper = s => s;
|
||||
|
||||
CopyFile node = new ();
|
||||
node.CopyFolder = true;
|
||||
node.DestinationPath = "/mnt/tempNAS/media/dvd/output";
|
||||
node.DestinationFile = "{file.Orig.FileName}p.DVD.x264.slow.CRF16{ext}";
|
||||
var result = node.Execute(args);
|
||||
Assert.AreEqual(2, result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user