# Path: enerdata/datetime/timezone.py
# TIMEZONE = timezone('Europe/Madrid')


from expects.testing import failure
from expects import *
from enerdata.contracts.tariff import *
from datetime import datetime, timedelta
from enerdata.datetime.timezone import TIMEZONE
from mamba import before, context, description, it
            ('3.1A', T31A),
            ('3.1A LB', T31A),
        ]

        tariff_cof = {
            '2.0A': 'A',
            '2.0DHA': 'B',
            '2.0DHS': 'D',
            '2.1A': 'A',
            '2.1DHA': 'B',
            '2.1DHS': 'D',
            '3.0A': 'C',
            '3.1A': 'C',
            '3.1A LB': 'C',
        }

        for t in tariffs:
            t_obj = get_tariff_by_code(t[0])()
            assert isinstance(t_obj, t[1])
            assert t_obj.cof, "Object doesn't have cof attribute"
            assert t_obj.cof == tariff_cof[t[0]], "Object cof not match with expected one"


    with it('must return None if the code is not in available'):
        t = get_tariff_by_code('NO_EXISTS')
        expect(t).to(be_none)

with description('Correct period for tariff an hour'):
    with before.all:
        self.winter_holiday_day = TIMEZONE.localize(datetime(2014, 11, 1))

# Path: enerdata/datetime/timezone.py
# TIMEZONE = timezone('Europe/Madrid')


# Path: spec/contracts/tariff_spec.py
from expects.testing import failure
from expects import *
from enerdata.contracts.tariff import *
from datetime import datetime, timedelta
from enerdata.datetime.timezone import TIMEZONE
from mamba import before, context, description, it

            ('3.1A', T31A),
            ('3.1A LB', T31A),
        ]

        tariff_cof = {
            '2.0A': 'A',
            '2.0DHA': 'B',
            '2.0DHS': 'D',
            '2.1A': 'A',
            '2.1DHA': 'B',
            '2.1DHS': 'D',
            '3.0A': 'C',
            '3.1A': 'C',
            '3.1A LB': 'C',
        }

        for t in tariffs:
            t_obj = get_tariff_by_code(t[0])()
            assert isinstance(t_obj, t[1])
            assert t_obj.cof, "Object doesn't have cof attribute"
            assert t_obj.cof == tariff_cof[t[0]], "Object cof not match with expected one"


    with it('must return None if the code is not in available'):
        t = get_tariff_by_code('NO_EXISTS')
        expect(t).to(be_none)

with description('Correct period for tariff an hour'):
    with before.all:
        self.winter_holiday_day = TIMEZONE.localize(datetime(2014, 11, 1))

        self.summer_holiday_day = TIMEZONE.localize(datetime(2014, 8, 15))