test_urbanDrainageTS.py 1.47 KB
Newer Older
andy.disch's avatar
andy.disch committed
1 2 3 4 5 6 7 8
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""Example test file."""

import unittest
import datetime

andy.disch's avatar
andy.disch committed
9
from .context import exampletesting
andy.disch's avatar
andy.disch committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


class TestUrbanDrainageTS(unittest.TestCase):
    def setUp(self):
        time = [datetime.datetime.strptime('2018-01-01 12:00:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:05:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:10:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:15:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:20:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:25:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:30:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:35:00', '%Y-%m-%d %H:%M:%S'),
                datetime.datetime.strptime('2018-01-01 12:40:00', '%Y-%m-%d %H:%M:%S')]

        value = [6.789, 4.567, 9.09, 6.70, 8.70, 3.4, 2.3, 4.56, 2.78]

andy.disch's avatar
andy.disch committed
26 27 28 29
        self.test_case = exampletesting.UrbanDrainageTS(time, value)

        def tearDown(self):
            """tear down"""
andy.disch's avatar
andy.disch committed
30 31 32 33 34 35 36 37 38 39 40


class TestInit(TestUrbanDrainageTS):
    def test_initial_length(self):
        self.assertIsNotNone(self.test_case.time)
        self.assertIsNotNone(self.test_case.value)


class TestSampleEntropy(TestUrbanDrainageTS):
    def test_sample_entropy(self):
        self.assertIsNotNone(self.test_case)