# Path: ocbpy/ocb_time.py
# def get_datetime_fmt_len(datetime_fmt):
# def year_soy_to_datetime(yyyy, soy):
# def yyddd_to_date(yyddd):
# def convert_time(year=None, soy=None, yyddd=None, sod=None, date=None,
#                  tod=None, datetime_fmt="%Y-%m-%d %H:%M:%S"):
# def deg2hr(lon):
# def hr2deg(lt):
# def hr2rad(lt):
# def rad2hr(lon):
# def datetime2hr(dtime):
# def slt2glon(slt, dtime):
# def glon2slt(glon, dtime):
# def fix_range(values, min_val, max_val, val_range=None):


import datetime as dt
import numpy as np
import unittest
from sys import version_info
from ocbpy import ocb_time
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, AGB & GC
# Full license can be found in License.md
# -----------------------------------------------------------------------------
""" Tests the ocboundary class and functions
"""




class TestOCBTimeMethods(unittest.TestCase):
    def setUp(self):
        """ Set up test runs """

        self.dtime = dt.datetime(2001, 1, 1)
        self.dtime2 = dt.datetime(1901, 1, 1)

        if version_info.major == 2:
            self.assertRaisesRegex = self.assertRaisesRegexp

    def tearDown(self):
        """ Clean up after each test """

        del self.dtime, self.dtime2

    def test_year_soy_to_datetime(self):
        """ Test to see that the seconds of year conversion works
        """

# Path: ocbpy/ocb_time.py
# def get_datetime_fmt_len(datetime_fmt):
# def year_soy_to_datetime(yyyy, soy):
# def yyddd_to_date(yyddd):
# def convert_time(year=None, soy=None, yyddd=None, sod=None, date=None,
#                  tod=None, datetime_fmt="%Y-%m-%d %H:%M:%S"):
# def deg2hr(lon):
# def hr2deg(lt):
# def hr2rad(lt):
# def rad2hr(lon):
# def datetime2hr(dtime):
# def slt2glon(slt, dtime):
# def glon2slt(glon, dtime):
# def fix_range(values, min_val, max_val, val_range=None):


# Path: ocbpy/tests/test_ocb_time.py
import datetime as dt
import numpy as np
import unittest
from sys import version_info
from ocbpy import ocb_time

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, AGB & GC
# Full license can be found in License.md
# -----------------------------------------------------------------------------
""" Tests the ocboundary class and functions
"""




class TestOCBTimeMethods(unittest.TestCase):
    def setUp(self):
        """ Set up test runs """

        self.dtime = dt.datetime(2001, 1, 1)
        self.dtime2 = dt.datetime(1901, 1, 1)

        if version_info.major == 2:
            self.assertRaisesRegex = self.assertRaisesRegexp

    def tearDown(self):
        """ Clean up after each test """

        del self.dtime, self.dtime2

    def test_year_soy_to_datetime(self):
        """ Test to see that the seconds of year conversion works
        """

        self.assertEqual(ocb_time.year_soy_to_datetime(2001, 0), self.dtime)