# Path: habitat/sensors/stdtelem.py
# def time(data):
# def coordinate(config, data):
# def binary_timestamp(data):
# def binary_bcd_time(data):


from nose.tools import raises, assert_raises
from ...sensors import stdtelem
# (at your option) any later version.
#
# habitat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with habitat.  If not, see <http://www.gnu.org/licenses/>.

"""
Tests the stdtelem sensor functions
"""



class TestStdtelem:
    def test_valid_times(self):
        times = [
            ("12:00:00", "12:00:00"),
            ("11:15:10", "11:15:10"),
            ("00:00:00", "00:00:00"),
            ("23:59:59", "23:59:59"),
            ("12:00",  "12:00:00"),
            ("01:24",  "01:24:00"),
            ("123456", "12:34:56"),
            ("0124",   "01:24:00")
        ]

        for i in times:

# Path: habitat/sensors/stdtelem.py
# def time(data):
# def coordinate(config, data):
# def binary_timestamp(data):
# def binary_bcd_time(data):


# Path: habitat/tests/test_sensors/test_stdtelem.py
from nose.tools import raises, assert_raises
from ...sensors import stdtelem

# (at your option) any later version.
#
# habitat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with habitat.  If not, see <http://www.gnu.org/licenses/>.

"""
Tests the stdtelem sensor functions
"""



class TestStdtelem:
    def test_valid_times(self):
        times = [
            ("12:00:00", "12:00:00"),
            ("11:15:10", "11:15:10"),
            ("00:00:00", "00:00:00"),
            ("23:59:59", "23:59:59"),
            ("12:00",  "12:00:00"),
            ("01:24",  "01:24:00"),
            ("123456", "12:34:56"),
            ("0124",   "01:24:00")
        ]

        for i in times:

            assert stdtelem.time(i[0]) == i[1]