Пример #1
0
    def test_config_contains_cloud_init_config(self):
        config = clash.MachineConfig(
            self.gcloud.get_compute_client(),
            "_",
            clash.CloudInitConfig("myname", "_", TEST_JOB_CONFIG),
            TEST_JOB_CONFIG,
        )

        machine_config = config.to_dict()

        assert machine_config["metadata"]["items"][0]["key"] == "user-data"
        cloud_init = yaml.load(machine_config["metadata"]["items"][0]["value"])
        assert cloud_init["users"][0]["name"] == "clash"
Пример #2
0
 def setup(self):
     self.gcloud = CloudSdkStub()
     self.cloud_init = clash.CloudInitConfig("_", "", TEST_JOB_CONFIG)