# 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 pytest
from punch import version_part as vpart
    assert vp.name == 'major'
    assert vp.value == 1
    assert isinstance(vp, vpart.IntegerVersionPart)


def test_get_integer_version_part_from_partial_dict():
    input_dict = {
        'name': 'major',
        'value': 1,
    }

    vp = vpart.VersionPart.from_dict(input_dict)

    assert vp.name == 'major'
    assert vp.value == 1
    assert isinstance(vp, vpart.IntegerVersionPart)


def test_get_value_list_version_part_from_full_dict():
    input_dict = {
        'name': 'major',
        'value': 'alpha',
        'type': 'value_list',
        'allowed_values': ['alpha', 'beta', 'stable']
    }

    vp = vpart.VersionPart.from_dict(input_dict)

    assert vp.name == 'major'
    assert vp.value == 'alpha'

# 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_part.py
import pytest
from punch import version_part as vpart

    assert vp.name == 'major'
    assert vp.value == 1
    assert isinstance(vp, vpart.IntegerVersionPart)


def test_get_integer_version_part_from_partial_dict():
    input_dict = {
        'name': 'major',
        'value': 1,
    }

    vp = vpart.VersionPart.from_dict(input_dict)

    assert vp.name == 'major'
    assert vp.value == 1
    assert isinstance(vp, vpart.IntegerVersionPart)


def test_get_value_list_version_part_from_full_dict():
    input_dict = {
        'name': 'major',
        'value': 'alpha',
        'type': 'value_list',
        'allowed_values': ['alpha', 'beta', 'stable']
    }

    vp = vpart.VersionPart.from_dict(input_dict)

    assert vp.name == 'major'
    assert vp.value == 'alpha'

    assert isinstance(vp, vpart.ValueListVersionPart)