# Path: punch/file_configuration.py
# class FileConfiguration(object):
#     def __init__(self, filepath, local_variables, global_variables=None):
#     def from_dict(cls, dic, global_variables):


import pytest
from punch import file_configuration as fc
    }


@pytest.fixture
def file_configuration_dict():
    return {
        'path': 'pkg/__init__.py',
        'serializer': '{{ major }}.{{ minor }}'
    }


def test_file_configuration_from_string_local_variables_take_precedence(
        local_variables, global_variables):
    fconf = fc.FileConfiguration(
        'pkg/__init__.py',
        local_variables,
        global_variables
    )

    assert fconf.path == 'pkg/__init__.py'
    assert fconf.config['serializer'] == '{{ major }}.{{ minor }}'
    assert fconf.config['mark'] == 'just a mark'


def test_file_configuration_from_string_cannot_include_global_variables(
        global_variables):

    local_variables = {
        'serializer': '__version__ = {{GLOBALS.serializer}}'
    }

# 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: tests/test_file_configuration.py
import pytest
from punch import file_configuration as fc

    }


@pytest.fixture
def file_configuration_dict():
    return {
        'path': 'pkg/__init__.py',
        'serializer': '{{ major }}.{{ minor }}'
    }


def test_file_configuration_from_string_local_variables_take_precedence(
        local_variables, global_variables):
    fconf = fc.FileConfiguration(
        'pkg/__init__.py',
        local_variables,
        global_variables
    )

    assert fconf.path == 'pkg/__init__.py'
    assert fconf.config['serializer'] == '{{ major }}.{{ minor }}'
    assert fconf.config['mark'] == 'just a mark'


def test_file_configuration_from_string_cannot_include_global_variables(
        global_variables):

    local_variables = {
        'serializer': '__version__ = {{GLOBALS.serializer}}'
    }

    fconf = fc.FileConfiguration(