def test_debug_configuration_set(self): mode = "Debug" options = None action = RunPackageAction( self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, self.os_utils ) zipFilePath = os.path.join("/", "artifacts_dir", "source_dir.zip") action.execute() self.subprocess_dotnet.run.assert_called_once_with( ["lambda", "package", "--output-package", zipFilePath, "--configuration", "Debug"], cwd="/source_dir" )
def test_build_package(self): mode = "Release" options = {} action = RunPackageAction(self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, self.os_utils) action.execute() zipFilePath = os.path.join("/", "artifacts_dir", "source_dir.zip") self.subprocess_dotnet.run.assert_called_once_with( ["lambda", "package", "--output-package", zipFilePath], cwd="/source_dir")
def test_build_package(self): self.subprocess_dotnet.reset_mock() options = {} action = RunPackageAction(self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, self.os_utils) action.execute() if platform.system().lower() == 'windows': zipFilePath = '/artifacts_dir\\source_dir.zip' else: zipFilePath = '/artifacts_dir/source_dir.zip' self.subprocess_dotnet.run.assert_called_once_with(['lambda', 'package', '--output-package', zipFilePath], cwd='/source_dir')
def test_build_package(self): mode = "Release" options = {} action = RunPackageAction(self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, self.os_utils) action.execute() zipFilePath = os.path.join('/', 'artifacts_dir', 'source_dir.zip') self.subprocess_dotnet.run.assert_called_once_with( ['lambda', 'package', '--output-package', zipFilePath], cwd='/source_dir')
def test_build_package_x86(self): mode = "Release" options = {} action = RunPackageAction( self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, X86_64, os_utils=self.os_utils ) action.execute() zip_path = os.path.join(self.artifacts_dir, "source_dir.zip") self.subprocess_dotnet.run.assert_called_once_with( ["lambda", "package", "--output-package", zip_path, "--msbuild-parameters", "--runtime linux-x64"], cwd="/source_dir", )
def test_debug_configuration_set(self): mode = "Debug" options = None action = RunPackageAction(self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, self.os_utils) zipFilePath = os.path.join('/', 'artifacts_dir', 'source_dir.zip') action.execute() self.subprocess_dotnet.run.assert_called_once_with([ 'lambda', 'package', '--output-package', zipFilePath, '--configuration', 'Debug' ], cwd='/source_dir')
def test_build_error(self): self.subprocess_dotnet.reset_mock() self.subprocess_dotnet.run.side_effect = DotnetCLIExecutionError(message="Failed Package") options = {} action = RunPackageAction(self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, self.os_utils) self.assertRaises(ActionFailedError, action.execute)
def test_build_package_arguments(self): mode = "Release" options = {"--framework": "netcoreapp2.1"} action = RunPackageAction( self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, self.os_utils ) action.execute() if platform.system().lower() == "windows": zipFilePath = "/artifacts_dir\\source_dir.zip" else: zipFilePath = "/artifacts_dir/source_dir.zip" self.subprocess_dotnet.run.assert_called_once_with( ["lambda", "package", "--output-package", zipFilePath, "--framework", "netcoreapp2.1"], cwd="/source_dir" )
def test_build_package_arguments(self): mode = "Release" options = {"--framework": "netcoreapp2.1"} action = RunPackageAction(self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, self.os_utils) action.execute() if platform.system().lower() == 'windows': zipFilePath = '/artifacts_dir\\source_dir.zip' else: zipFilePath = '/artifacts_dir/source_dir.zip' self.subprocess_dotnet.run.assert_called_once_with([ 'lambda', 'package', '--output-package', zipFilePath, '--framework', 'netcoreapp2.1' ], cwd='/source_dir')
def test_build_package_arguments(self): mode = "Release" options = {"--framework": "netcoreapp2.1"} action = RunPackageAction( self.source_dir, self.subprocess_dotnet, self.artifacts_dir, options, mode, os_utils=self.os_utils ) action.execute() zip_path = self.artifacts_dir + ("\\" if platform.system().lower() == "windows" else "/") + "source_dir.zip" self.subprocess_dotnet.run.assert_called_once_with( [ "lambda", "package", "--output-package", zip_path, "--msbuild-parameters", "--runtime linux-x64", "--framework", "netcoreapp2.1", ], cwd="/source_dir", )