How to use the ddt.data.dataset.dates function in ddt

To help you get started, we’ve selected a few ddt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattduck / wbpy / tests / indicators.py View on Github external
def test_datetime_param_monthly(self):
        data = Monthly()
        results = data.dataset.dates(use_datetime=True)
        self.assertEqual(results[0], datetime.date(2013, 2, 1))
        self.assertEqual(results[-1], datetime.date(2013, 8, 1))
github mattduck / wbpy / tests / climate.py View on Github external
def test_mavg_datetime(self):
        data = ModelledVarMAVG()
        dt = lambda x: datetime.date(x, 1, 1)
        expected = [(dt(2020), dt(2039)), (dt(2040), dt(2059))]
        self.assertEqual(data.dataset.dates(use_datetime=True), expected)
github mattduck / wbpy / tests / climate.py View on Github external
def test_stat(self):
        data = ModelledStat()
        expected = [("2046", "2065")]
        self.assertEqual(data.dataset.dates(), expected)
github mattduck / wbpy / tests / climate.py View on Github external
def test_aanom_datetime(self):
        data = ModelledVarAANOM()
        dt = lambda x: datetime.date(x, 1, 1)
        expected = [(dt(2020), dt(2039)), (dt(2060), dt(2079))]
        self.assertEqual(data.dataset.dates(use_datetime=True), expected)
github mattduck / wbpy / tests / climate.py View on Github external
def test_mavg(self):
        data = ModelledVarMAVG()
        expected = [("2020", "2039"), ("2040", "2059")]
        self.assertEqual(data.dataset.dates(), expected)
github mattduck / wbpy / tests / indicators.py View on Github external
def test_datetime_param_quarterly(self):
        data = Quarterly()
        results = data.dataset.dates(use_datetime=True)
        self.assertEqual(results[0], datetime.date(2011, 4, 1))
        self.assertEqual(results[-1], datetime.date(2013, 7, 1))
github mattduck / wbpy / tests / indicators.py View on Github external
def test_datetime_param_yearly(self):
        data = Yearly()
        results = data.dataset.dates(use_datetime=True)
        expected = [datetime.date(2011, 1, 1), datetime.date(2012, 1, 1)]
        self.assertEqual(results, expected)
github mattduck / wbpy / tests / climate.py View on Github external
def test_aanom(self):
        data = ModelledVarAANOM()
        expected = [("2020", "2039"), ("2060", "2079")]
        self.assertEqual(data.dataset.dates(), expected)

ddt

Data-Driven/Decorated Tests

MIT
Latest version published 10 months ago

Package Health Score

71 / 100
Full package analysis