示例#1
0
    def test_project_config_validate_check_correct(self):
        FLAGS.projects = ['*']
        datathon_path = ('deploy/samples/datathon_team_project.yaml')
        root_config = utils.read_yaml_file(datathon_path)
        utils.resolve_env_vars(root_config)
        root_config['overall']['allowed_apis'] = [
            'bigquery-json.googleapis.com',
            'compute.googleapis.com',
            'ml.googleapis.com',
        ]

        with tempfile.TemporaryDirectory() as tmp_dir:
            FLAGS.output_yaml_path = os.path.join(tmp_dir, 'conf.yaml')
            FLAGS.project_yaml = FLAGS.output_yaml_path
            with open(FLAGS.project_yaml, 'w') as f:
                yaml = ruamel.yaml.YAML()
                yaml.dump(root_config, f)
                f.flush()
            create_project.main([])
def _deploy(config_filename):
    FLAGS.project_yaml = os.path.join('deploy/samples/', config_filename)
    FLAGS.projects = ['*']
    with tempfile.TemporaryDirectory() as tmp_dir:
        FLAGS.generated_fields_path = os.path.join(tmp_dir, 'generated.yaml')
        create_project.main([])
def _deploy(config_filename):
    FLAGS.project_yaml = os.path.join(FLAGS.test_srcdir, 'deploy/samples/',
                                      config_filename)
    with tempfile.NamedTemporaryFile() as f:
        FLAGS.output_yaml_path = f.name
        create_project.main([])
 def test_create_project_with_spanned_configs(self):
     FLAGS.project_yaml = ('deploy/samples/spanned_configs/root.yaml')
     FLAGS.projects = ['*']
     create_project.main([])
def _deploy(config_filename):
    FLAGS.project_yaml = os.path.join('deploy/samples/', config_filename)
    FLAGS.projects = ['*']
    create_project.main([])
示例#6
0
 def test_create_project_with_spanned_configs(self):
     FLAGS.project_yaml = ('deploy/samples/spanned_configs/root.yaml')
     FLAGS.projects = ['*']
     with tempfile.TemporaryDirectory() as tmp_dir:
         FLAGS.output_yaml_path = os.path.join(tmp_dir, 'out.yaml')
         create_project.main([])
 def test_create_project_with_spanned_configs(self):
   FLAGS.project_yaml = (
       'deploy/samples/spanned_configs/root.yaml')
   with tempfile.NamedTemporaryFile() as f:
     FLAGS.output_yaml_path = f.name
     create_project.main([])