# Path: punch/config.py
# class ConfigurationVersionError(Exception):
# class PunchConfig(object):
#     def __init__(self, config_filepath):


import os
import pytest
    import sys
from punch import config as pc
    with pytest.raises(ValueError):
        pc.PunchConfig(os.path.join(temp_empty_dir, config_file_name))


def test_read_files(temp_empty_dir, config_file_content, config_file_name,
                    version_file_content, version_file_name):
    clean_previous_imports()

    write_file(temp_empty_dir, config_file_content, config_file_name)
    write_file(temp_empty_dir, version_file_content, version_file_name)

    cf = pc.PunchConfig(os.path.join(temp_empty_dir, config_file_name))

    assert len(cf.files) == 2
    assert [fc.path for fc in cf.files] == ['pkg/__init__.py', 'version.txt']


def test_read_version_missing_version(
        temp_empty_dir, config_file_content_without_globals_without_version,
        config_file_name, version_file_content, version_file_name):
    clean_previous_imports()

    write_file(
        temp_empty_dir,
        config_file_content_without_globals_without_version,
        config_file_name
    )
    write_file(temp_empty_dir, version_file_content, version_file_name)

    with pytest.raises(ValueError):

# Path: punch/config.py
# class ConfigurationVersionError(Exception):
# class PunchConfig(object):
#     def __init__(self, config_filepath):


# Path: tests/test_config.py
import os
import pytest
    import sys
from punch import config as pc

    with pytest.raises(ValueError):
        pc.PunchConfig(os.path.join(temp_empty_dir, config_file_name))


def test_read_files(temp_empty_dir, config_file_content, config_file_name,
                    version_file_content, version_file_name):
    clean_previous_imports()

    write_file(temp_empty_dir, config_file_content, config_file_name)
    write_file(temp_empty_dir, version_file_content, version_file_name)

    cf = pc.PunchConfig(os.path.join(temp_empty_dir, config_file_name))

    assert len(cf.files) == 2
    assert [fc.path for fc in cf.files] == ['pkg/__init__.py', 'version.txt']


def test_read_version_missing_version(
        temp_empty_dir, config_file_content_without_globals_without_version,
        config_file_name, version_file_content, version_file_name):
    clean_previous_imports()

    write_file(
        temp_empty_dir,
        config_file_content_without_globals_without_version,
        config_file_name
    )
    write_file(temp_empty_dir, version_file_content, version_file_name)

    with pytest.raises(ValueError):

        pc.PunchConfig(os.path.join(temp_empty_dir, config_file_name))