コード例 #1
0
ファイル: test_utility.py プロジェクト: zhuima/iotedgedev
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"
コード例 #2
0
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"
コード例 #3
0
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
コード例 #4
0
ファイル: test_utility.py プロジェクト: zhuima/iotedgedev
def utility():
    output = Output()
    envvars = EnvVars(output)
    envvars.load()
    return Utility(envvars, output)
コード例 #5
0
ファイル: test_utility.py プロジェクト: zhuima/iotedgedev
def test_get_sha256_hash():
    assert Utility.get_sha256_hash(
        "foo"
    ) == "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
コード例 #6
0
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
コード例 #7
0
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
コード例 #8
0
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"