# Path: punch/file_configuration.py
# class FileConfiguration(object):
#     def __init__(self, filepath, local_variables, global_variables=None):
#     def from_dict(cls, dic, global_variables):
# 
# Path: punch/file_updater.py
# class FileUpdater(object):
#     def __init__(self, file_configuration, replacer):
#     def get_summary(self, current_version, new_version):
#     def update(self, current_version, new_version):
# 
# Path: punch/replacer.py
# class MissingSerializer(Exception):
# class Replacer(object):
#     def __init__(self, serializers, main_serialize_name='0'):
#     def update(self, serializers):
#     def run_serializer(self, serializer_name,
#                        current_version_dict, new_version_dict):
#     def run_all_serializers(self, current_version_dict, new_version_dict):
#     def replace(self, text, current_version_dict, new_version_dict):


import os
import pytest
import six
from punch import file_configuration as fc
from punch import file_updater as fu
from punch import replacer
    updater = fu.FileUpdater(file_config, rep)
    updater.update(current_version, new_version)

    with open(filepath, 'r') as f:
        new_file_content = f.read()

    assert new_file_content == "__version⚠__ = \"1.2.4\""


def test_file_updater_with_partial_serializer(
        temp_dir_with_version_file_partial):
    filepath = os.path.join(temp_dir_with_version_file_partial, "__init__.py")

    current_version = {
        'major': 1,
        'minor': 2,
        'patch': 3
    }
    new_version = {
        'major': 1,
        'minor': 3,
        'patch': 0
    }

    local_variables = {
        'serializer': "__version__ = \"{{major}}.{{minor}}\""
    }

    file_config = fc.FileConfiguration(filepath, local_variables)


# Path: punch/file_configuration.py
# class FileConfiguration(object):
#     def __init__(self, filepath, local_variables, global_variables=None):
#     def from_dict(cls, dic, global_variables):
# 
# Path: punch/file_updater.py
# class FileUpdater(object):
#     def __init__(self, file_configuration, replacer):
#     def get_summary(self, current_version, new_version):
#     def update(self, current_version, new_version):
# 
# Path: punch/replacer.py
# class MissingSerializer(Exception):
# class Replacer(object):
#     def __init__(self, serializers, main_serialize_name='0'):
#     def update(self, serializers):
#     def run_serializer(self, serializer_name,
#                        current_version_dict, new_version_dict):
#     def run_all_serializers(self, current_version_dict, new_version_dict):
#     def replace(self, text, current_version_dict, new_version_dict):


# Path: tests/test_file_updater.py
import os
import pytest
import six
from punch import file_configuration as fc
from punch import file_updater as fu
from punch import replacer

    updater = fu.FileUpdater(file_config, rep)
    updater.update(current_version, new_version)

    with open(filepath, 'r') as f:
        new_file_content = f.read()

    assert new_file_content == "__version⚠__ = \"1.2.4\""


def test_file_updater_with_partial_serializer(
        temp_dir_with_version_file_partial):
    filepath = os.path.join(temp_dir_with_version_file_partial, "__init__.py")

    current_version = {
        'major': 1,
        'minor': 2,
        'patch': 3
    }
    new_version = {
        'major': 1,
        'minor': 3,
        'patch': 0
    }

    local_variables = {
        'serializer': "__version__ = \"{{major}}.{{minor}}\""
    }

    file_config = fc.FileConfiguration(filepath, local_variables)


    rep = replacer.Replacer(file_config.config['serializer'])