# Path: console/utils.py
# def daterange(start_date, end_date):
#     for n in xrange((end_date - start_date).days + 1):
#         yield start_date + timedelta(n)


import random
import json
from datetime import date, timedelta
from django.test import TestCase
from django.conf import settings
from django.utils.six.moves import xrange
from uwsgiit.api import UwsgiItClient
from console.utils import daterange
from console.models import *
            cls.test_metrics.append(test_metric)

    @classmethod
    def destroyTestMetrics(cls):
        for metric in cls.test_metrics:
            metric.delete()


class ContainerMetricTests(MetricTesterMixin, TestCase):

    @classmethod
    def setUpClass(cls):
        cls.createTestMetrics(NetworkRXContainerMetric)
        cls.today = date.today()
        cls.yesterday = cls.today - timedelta(1)
        cls.tomorrow = cls.today + timedelta(1)

    def test_IOReadContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(IOReadContainerMetric().unit_of_measure, 'bytes')

    def test_IOWriteContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(IOWriteContainerMetric().unit_of_measure, 'bytes')

    def test_NetworkRXContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(NetworkRXContainerMetric().unit_of_measure, 'bytes')

    def test_NetworkTXContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(NetworkTXContainerMetric().unit_of_measure, 'bytes')

    def test_CPUContainerMetric_returns_right_unit_of_measure(self):

# Path: console/utils.py
# def daterange(start_date, end_date):
#     for n in xrange((end_date - start_date).days + 1):
#         yield start_date + timedelta(n)


# Path: console/tests/test_models.py
import random
import json
from datetime import date, timedelta
from django.test import TestCase
from django.conf import settings
from django.utils.six.moves import xrange
from uwsgiit.api import UwsgiItClient
from console.utils import daterange
from console.models import *

            cls.test_metrics.append(test_metric)

    @classmethod
    def destroyTestMetrics(cls):
        for metric in cls.test_metrics:
            metric.delete()


class ContainerMetricTests(MetricTesterMixin, TestCase):

    @classmethod
    def setUpClass(cls):
        cls.createTestMetrics(NetworkRXContainerMetric)
        cls.today = date.today()
        cls.yesterday = cls.today - timedelta(1)
        cls.tomorrow = cls.today + timedelta(1)

    def test_IOReadContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(IOReadContainerMetric().unit_of_measure, 'bytes')

    def test_IOWriteContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(IOWriteContainerMetric().unit_of_measure, 'bytes')

    def test_NetworkRXContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(NetworkRXContainerMetric().unit_of_measure, 'bytes')

    def test_NetworkTXContainerMetric_returns_right_unit_of_measure(self):
        self.assertEqual(NetworkTXContainerMetric().unit_of_measure, 'bytes')

    def test_CPUContainerMetric_returns_right_unit_of_measure(self):

        self.assertEqual(CPUContainerMetric().unit_of_measure, 'ticks')