def test_get_nonexistent_cluster_config(self, cluster: Cluster):
     """Test get nonexistent cluster config"""
     # we try to get a nonexistant cluster config, test should raise exception
     with allure.step(f"Removing cluster id={cluster.id}"):
         cluster.delete()
     with allure.step("Get cluster config from non existent cluster"):
         with pytest.raises(coreapi.exceptions.ErrorMessage) as e:
             cluster.config()
     with allure.step("Check that cluster doesn't exist"):
         err.CLUSTER_NOT_FOUND.equal(e, "Cluster", "does not exist")
 def test_create_new_config_version_with_one_req_parameter(
         self, cluster: Cluster):
     """Test create new cluster config with one parameter"""
     cfg = {"required": 42}
     expected = cluster.config_set(cfg)
     with allure.step("Check new config"):
         assert cluster.config() == expected
 def test_create_new_config_version_with_other_parameters(
         self, cluster: Cluster):
     """Test create new cluster config with many parameters"""
     cfg = {"required": 99, "str-key": utils.random_string()}
     expected = cluster.config_set(cfg)
     with allure.step("Check new config"):
         assert cluster.config() == expected
 def test_read_default_cluster_config(self, cluster: Cluster):
     """Validate default cluster config by schema"""
     config = cluster.config(full=True)
     config_json = utils.ordered_dict_to_dict(config)
     with allure.step("Load schema"):
         with open(SCHEMAS + "/config_item_schema.json",
                   encoding='utf_8') as file:
             schema = json.load(file)
     with allure.step("Check schema"):
         assert validate(config_json, schema) is None
 def test_check_that_file_field_put_correct_data_in_file_inside_docker(
         self, cluster: Cluster):
     """Another mysterious type checking test"""
     test_data = "lorem ipsum"
     with allure.step("Create config data"):
         config_data = utils.ordered_dict_to_dict(cluster.config())
         config_data["input_file"] = test_data
         config_data["required"] = 42
     with allure.step("Create config history"):
         cluster.config_set(config_data)
     with allure.step("Check file type"):
         run_cluster_action_and_assert_result(cluster=cluster,
                                              action="check-file-type")