# Path: punch/version.py
# class Version():
#     def __init__(self):
#     def keys(self):
#     def values(self):
#     def __eq__(self, other):
#     def add_part(self, part):
#     def create_part(self, name, value,
#                     cls=vpart.IntegerVersionPart, *args, **kwds):
#     def add_part_from_dict(self, dic):
#     def get_part(self, name):
#     def _reset_following_parts(self, name):
#     def inc(self, name):
#     def set(self, adict):
#     def set_and_reset(self, name, value):
#     def copy(self):
#     def as_dict(self):
#     def as_list(self):
#     def to_file(self, version_filepath):
#     def from_file(cls, version_filepath, version_description):
#     def _get_version_part(cls, version_module,
#                           version_part, version_part_name):
# 
# Path: punch/version_part.py
# def _strftime(fmt):
# def strftime(fmt):
#     def from_dict(cls, dic):
#     def __init__(self, name, value=None, start_value=None):
#     def inc(self):
#     def set(self, value):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, allowed_values):
#     def set(self, value):
#     def inc(self):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, fmt):
#     def reset(self):
#     def inc(self):
#     def copy(self):
# class VersionPart(object):
# class IntegerVersionPart(VersionPart):
# class ValueListVersionPart(VersionPart):
# class DateVersionPart(VersionPart):


import os
import pytest
    import sys
from punch import version as ver
from punch import version_part as vp

    version_description = [
        {
            'name': 'major',
            'type': 'integer'
        },
        {
            'name': 'minor',
            'type': 'integer'
        },
        {
            'name': 'patch',
            'type': 'integer'
        }
    ]

    with pytest.raises(ValueError):
        ver.Version.from_file(version_filepath, version_description)


def test_read_simplified_version_from_file(temp_empty_dir, version_mmp):
    clean_previous_imports()

    version_filepath = os.path.join(temp_empty_dir, 'punch_version.py')

    with open(version_filepath, 'w') as f:
        f.writelines(["major = 4\n", "minor = 3\n", "patch = 1\n"])

    version_description = ['major', 'minor', 'patch']


# Path: punch/version.py
# class Version():
#     def __init__(self):
#     def keys(self):
#     def values(self):
#     def __eq__(self, other):
#     def add_part(self, part):
#     def create_part(self, name, value,
#                     cls=vpart.IntegerVersionPart, *args, **kwds):
#     def add_part_from_dict(self, dic):
#     def get_part(self, name):
#     def _reset_following_parts(self, name):
#     def inc(self, name):
#     def set(self, adict):
#     def set_and_reset(self, name, value):
#     def copy(self):
#     def as_dict(self):
#     def as_list(self):
#     def to_file(self, version_filepath):
#     def from_file(cls, version_filepath, version_description):
#     def _get_version_part(cls, version_module,
#                           version_part, version_part_name):
# 
# Path: punch/version_part.py
# def _strftime(fmt):
# def strftime(fmt):
#     def from_dict(cls, dic):
#     def __init__(self, name, value=None, start_value=None):
#     def inc(self):
#     def set(self, value):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, allowed_values):
#     def set(self, value):
#     def inc(self):
#     def reset(self):
#     def copy(self):
#     def __init__(self, name, value, fmt):
#     def reset(self):
#     def inc(self):
#     def copy(self):
# class VersionPart(object):
# class IntegerVersionPart(VersionPart):
# class ValueListVersionPart(VersionPart):
# class DateVersionPart(VersionPart):


# Path: tests/test_version.py
import os
import pytest
    import sys
from punch import version as ver
from punch import version_part as vp


    version_description = [
        {
            'name': 'major',
            'type': 'integer'
        },
        {
            'name': 'minor',
            'type': 'integer'
        },
        {
            'name': 'patch',
            'type': 'integer'
        }
    ]

    with pytest.raises(ValueError):
        ver.Version.from_file(version_filepath, version_description)


def test_read_simplified_version_from_file(temp_empty_dir, version_mmp):
    clean_previous_imports()

    version_filepath = os.path.join(temp_empty_dir, 'punch_version.py')

    with open(version_filepath, 'w') as f:
        f.writelines(["major = 4\n", "minor = 3\n", "patch = 1\n"])

    version_description = ['major', 'minor', 'patch']


    version = ver.Version.from_file(version_filepath, version_description)