예제 #1
0
def config_instance(temp_files):
    # TODO(retr0h): Rework molecule config so we can pass a generic
    # config here.  Molecule currently expects to find a 'vagrant'
    # key in this dict.
    c = temp_files(fixtures=['molecule_vagrant_v1_config'])

    return config.ConfigV1(configs=c)
예제 #2
0
def openstack_molecule_instance(temp_dir, temp_files, state_path_without_data):
    c = temp_files(fixtures=['molecule_openstack_v1_config'])
    m = core.Molecule(config.ConfigV1(configs=c), {})
    m.state = state.State(state_file=state_path_without_data)
    m.main()

    return m
예제 #3
0
def test_combine_local_config_overrides_default_and_project_config(temp_files):
    c = temp_files(fixtures=[
        'default_config_data', 'project_config_data', 'local_config_data'
    ])
    config_instance = config.ConfigV1(configs=c).config

    assert 'local-override' == config_instance['foo']
    assert 'local-override' == config_instance['baz']
예제 #4
0
def molecule_instance_with_env_expansion(temp_dir, temp_files,
                                         state_path_without_data):
    os.environ['MOLECULE_TEST_01'] = 'vagrant'
    os.environ['MOLECULE_TEST_02'] = 'ubuntu'
    os.environ['MOLECULE_TEST_03'] = 'trusty64'
    os.environ['MOLECULE_TEST_04'] = 'example1'
    os.environ['MOLECULE_TEST_05'] = 'append_platform_to_hostname'
    c = temp_files(fixtures=['molecule_vagrant_v1_config_using_env'])
    m = core.Molecule(config.ConfigV1(configs=c), {})
    m.state = state.State(state_file=state_path_without_data)
    m.main()

    return m
예제 #5
0
def shell_instance(temp_files):
    confs = temp_files(fixtures=['molecule_vagrant_v1_config'])
    c = config.ConfigV1(configs=confs)
    c.config['dependency']['command'] = 'ls -l -a /tmp'

    return shell.Shell(c.config)
예제 #6
0
def ansible_galaxy_instance(temp_files):
    confs = temp_files(fixtures=['molecule_vagrant_v1_config'])
    c = config.ConfigV1(configs=confs)
    c.config['dependency']['requirements_file'] = 'requirements.yml'

    return ansible_galaxy.AnsibleGalaxy(c.config)
예제 #7
0
파일: base.py 프로젝트: vermuz/molecule
 def _get_config(self):
     return config.ConfigV1()
예제 #8
0
def test_build_config_paths_preserves_full_path(temp_files):
    confs = temp_files(fixtures=['build_config_paths_molecule_data'])
    c = config.ConfigV1(configs=confs)

    assert '/full/path/vagrantfile_file' == c.config['molecule'][
        'vagrantfile_file']
예제 #9
0
def test_combine_default_config(temp_files):
    c = temp_files(fixtures=['default_config_data'])
    config_instance = config.ConfigV1(configs=c).config

    assert 'bar' == config_instance['foo']
    assert 'qux' == config_instance['baz']
예제 #10
0
def test_molecule_file_exists(temp_files, patch_molecule_file_exists):
    configs = temp_files(fixtures=['molecule_vagrant_v1_config'])
    c = config.ConfigV1(configs=configs)

    assert c.molecule_file_exists()
예제 #11
0
def test_build_config_paths_preserves_relative_path(temp_files):
    confs = temp_files(fixtures=['build_config_paths_molecule_data'])
    c = config.ConfigV1(configs=confs)

    assert 'relative/path/rakefile_file' == c.config['molecule'][
        'rakefile_file']