diff --git a/scripts/ManualTests/copy_test.py b/scripts/ManualTests/copy_test.py index 3fb73c2..68aba34 100644 --- a/scripts/ManualTests/copy_test.py +++ b/scripts/ManualTests/copy_test.py @@ -2,7 +2,7 @@ from CommandBuilders.CopyCommandBuilder import CopyCommandBuilder from ManualTests.path_provider import PathProvider line1 = "copy 'BuildSample/BuildSample.sln' to 'BuildSample/BuildSample.txt'" -line2 = "copy 'BuildSample/BuildSample.sln' to '~/tmp/BuildSample.sln'" +line2 = "copy 'BuildSample/BuildSample.sln' to '~/Downloads/BuildSample.sln'" baseDir = '../' path_provider = PathProvider(baseDir) diff --git a/scripts/commands/CopyCommand.py b/scripts/commands/CopyCommand.py index c57b7ab..30d01be 100644 --- a/scripts/commands/CopyCommand.py +++ b/scripts/commands/CopyCommand.py @@ -1,4 +1,5 @@ import shutil +import os class CopyCommand: def __init__(self, pathProvider, copyArguments): @@ -9,5 +10,16 @@ class CopyCommand: self.__copyArguments = copyArguments def execute(self): - shutil.copy(self.__copyArguments.source, self.__copyArguments.target) + source = self.__expandPath(self.__copyArguments.source) + target = self.__expandPath(self.__copyArguments.target) + + shutil.copy(source, target) + + def __expandPath(self, path): + path = os.path.expanduser(path) + if not os.path.isabs(path): + path = self.__pathProvider.resolveAbsPath(path) + + return path + diff --git a/scripts/run_manual_tests.py b/scripts/run_manual_tests.py index 117f43b..dab7faf 100644 --- a/scripts/run_manual_tests.py +++ b/scripts/run_manual_tests.py @@ -1,2 +1,3 @@ -import ManualTests.csproj_test -import ManualTests.info_plist_test \ No newline at end of file +#import ManualTests.csproj_test +#import ManualTests.info_plist_test +import ManualTests.copy_test \ No newline at end of file