def test_get_deployment_manifest_name(): assert Utility.get_deployment_manifest_name( "config/deployment.template.json", "0.0.1", "amd64") == "deployment.json" assert Utility.get_deployment_manifest_name("deployment.template.json", "0.0.1", "amd64") == "deployment.json" assert Utility.get_deployment_manifest_name( "deployment.debug.template.json", "0.0.1", "amd64") == "deployment.debug.json" assert Utility.get_deployment_manifest_name( "config/deployment.template.json", "1.0.0", "amd64") == "deployment.amd64.json" assert Utility.get_deployment_manifest_name( "deployment.template.json", "1.0.0", "amd64") == "deployment.amd64.json" assert Utility.get_deployment_manifest_name( "deployment.debug.template.json", "1.0.0", "amd64") == "deployment.debug.amd64.json" assert Utility.get_deployment_manifest_name("", "", "") == "deployment.json" os.environ["DEPLOYMENT_CONFIG_FILE"] = "foo.json" assert Utility.get_deployment_manifest_name( "deployment.debug.template.json", "1.0.0", "amd64") == "foo.json"
def test_get_deployment_manifest_name(): assert Utility.get_deployment_manifest_name("config/deployment.template.json", "0.0.1", "amd64") == "deployment.json" assert Utility.get_deployment_manifest_name("deployment.template.json", "0.0.1", "amd64") == "deployment.json" assert Utility.get_deployment_manifest_name("deployment.debug.template.json", "0.0.1", "amd64") == "deployment.debug.json" assert Utility.get_deployment_manifest_name("config/deployment.template.json", "1.0.0", "amd64") == "deployment.amd64.json" assert Utility.get_deployment_manifest_name("deployment.template.json", "1.0.0", "amd64") == "deployment.amd64.json" assert Utility.get_deployment_manifest_name("deployment.debug.template.json", "1.0.0", "amd64") == "deployment.debug.amd64.json" assert Utility.get_deployment_manifest_name("", "", "") == "deployment.json"
def deployment_manifest(): output = Output() envvars = EnvVars(output) envvars.load() utility = Utility(envvars, output) def _deployment_manifest(path): return DeploymentManifest(envvars, output, utility, path, True) return _deployment_manifest
def utility(): output = Output() envvars = EnvVars(output) envvars.load() return Utility(envvars, output)
def test_get_sha256_hash(): assert Utility.get_sha256_hash( "foo" ) == "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
def get_docker_client(): envvars.load(force=True) utility = Utility(envvars, output) docker_client = Docker(envvars, utility, output) docker_client.init_registry() return docker_client
def test_add_module_template(deployment_manifest): deployment_manifest = deployment_manifest(test_file_1) deployment_manifest.add_module_template("csharpmodule2") expected = json.loads( Utility.get_file_contents(test_file_3, expandvars=True)) assert deployment_manifest.json == expected
def test_get_deployment_manifest_name__set_from_envvar(): assert Utility.get_deployment_manifest_name("deployment.debug.template.json", "1.0.0", "amd64") == "foo.json"