# 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
            assert self.tarifa.max_power == 100000

        with it('should have correct energy and power periods'):
            assert len(self.tarifa.energy_periods) == 6
            assert len(self.tarifa.power_periods) == 6
            assert self.tarifa.get_number_of_periods() == 6
            assert not self.tarifa.has_holidays_periods

        with it('with losses have a trafo kva and losses_coeff'):
            kwargs = {'kva': 50}
            self.tarifa = T61TD(**kwargs)
            assert self.tarifa.losses == 0.04
            assert self.tarifa.kva == 50
            assert self.tarifa.low_voltage_measure

    # Tariff 6.2TD
    with context("6.2TD"):
        with before.all:
            self.tarifa = T62TD()

        with it('should have code 6.2TD'):
            assert self.tarifa.code == '6.2TD'

        with it('should have correct power margins and type'):
            assert self.tarifa.type == 'AT'
            assert self.tarifa.min_power == 0
            assert self.tarifa.max_power == 100000

        with it('should have correct energy and power periods'):
            assert len(self.tarifa.energy_periods) == 6

# 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

            assert self.tarifa.max_power == 100000

        with it('should have correct energy and power periods'):
            assert len(self.tarifa.energy_periods) == 6
            assert len(self.tarifa.power_periods) == 6
            assert self.tarifa.get_number_of_periods() == 6
            assert not self.tarifa.has_holidays_periods

        with it('with losses have a trafo kva and losses_coeff'):
            kwargs = {'kva': 50}
            self.tarifa = T61TD(**kwargs)
            assert self.tarifa.losses == 0.04
            assert self.tarifa.kva == 50
            assert self.tarifa.low_voltage_measure

    # Tariff 6.2TD
    with context("6.2TD"):
        with before.all:
            self.tarifa = T62TD()

        with it('should have code 6.2TD'):
            assert self.tarifa.code == '6.2TD'

        with it('should have correct power margins and type'):
            assert self.tarifa.type == 'AT'
            assert self.tarifa.min_power == 0
            assert self.tarifa.max_power == 100000

        with it('should have correct energy and power periods'):
            assert len(self.tarifa.energy_periods) == 6

            assert len(self.tarifa.power_periods) == 6