# Path: greenpithumb/sleep_windows.py
# class Error(Exception):
# class InvalidWindowFormatError(Error):
# def parse(sleep_windows_raw):


import datetime
import unittest
from greenpithumb import sleep_windows



class TestSleepWindowParser(unittest.TestCase):

    def test_parser_valid_inputs(self):
        self.assertEqual(
            sleep_windows.parse(['01:00-03:15']), [(datetime.time(1, 0),
                                                    datetime.time(3, 15))])
        self.assertEqual(
            sleep_windows.parse(['01:00-03:15', '13:45-16:00']),
            [(datetime.time(1, 0), datetime.time(3, 15)), (datetime.time(
                13, 45), datetime.time(16, 0))])
        # Overlapping ranges OK.
        self.assertEqual(
            sleep_windows.parse(['01:00-03:15', '02:45-04:00']),
            [(datetime.time(1, 0), datetime.time(3, 15)),

# Path: greenpithumb/sleep_windows.py
# class Error(Exception):
# class InvalidWindowFormatError(Error):
# def parse(sleep_windows_raw):


# Path: tests/test_sleep_windows.py
import datetime
import unittest
from greenpithumb import sleep_windows




class TestSleepWindowParser(unittest.TestCase):

    def test_parser_valid_inputs(self):
        self.assertEqual(
            sleep_windows.parse(['01:00-03:15']), [(datetime.time(1, 0),
                                                    datetime.time(3, 15))])
        self.assertEqual(
            sleep_windows.parse(['01:00-03:15', '13:45-16:00']),
            [(datetime.time(1, 0), datetime.time(3, 15)), (datetime.time(
                13, 45), datetime.time(16, 0))])
        # Overlapping ranges OK.
        self.assertEqual(
            sleep_windows.parse(['01:00-03:15', '02:45-04:00']),
            [(datetime.time(1, 0), datetime.time(3, 15)),

             (datetime.time(2, 45), datetime.time(4, 0))])