コード例 #1
0
ファイル: tankworker.py プロジェクト: maksimovart/yandex-tank
def load_cfg(cfg_filename):
    """

    :type cfg_filename: str
    """
    if is_ini(cfg_filename):
        return convert_ini(cfg_filename)
    else:
        return yaml.load(read_resource(cfg_filename), Loader=yaml.FullLoader)
コード例 #2
0
def test_conflict_opts(ini_file, msgs):
    with pytest.raises(OptionsConflict) as e:
        convert_ini(os.path.join(os.path.dirname(__file__), ini_file))
    assert all([msg in e.value.message for msg in msgs])
コード例 #3
0
ファイル: test_converter.py プロジェクト: f2nd/yandex-tank
def test_conflict_opts(ini_file, msgs):
    with pytest.raises(OptionsConflict) as e:
        convert_ini(os.path.join(os.path.dirname(__file__), ini_file))
    assert all([msg in e.value.message for msg in msgs])
コード例 #4
0
def test_convert_ini_phantom(ini_file, yaml_file):
    with open(os.path.join(os.path.dirname(__file__), yaml_file), 'r') as f:
        assert convert_ini(os.path.join(os.path.dirname(__file__),
                                        ini_file)) == yaml.load(
                                            f, Loader=yaml.FullLoader)
コード例 #5
0
ファイル: test_converter.py プロジェクト: f2nd/yandex-tank
def test_convert_ini_phantom(ini_file, yaml_file):
    with open(os.path.join(os.path.dirname(__file__), yaml_file), 'r') as f:
        assert convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) == yaml.load(f)