# 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

    @raises(ValueError)
    def test_wants_config(self):
        stdtelem.coordinate({}, "001.1234")

    @raises(ValueError)
    def check_invalid_coordinate(self, s):
        config = {"format": s[0]}
        stdtelem.coordinate(config, s[1])

    def test_invalid_coordinates(self):
        invalid_coordinates = [
            ("dd.dddd", "asdf"),
            ("dd.dddd", "-200.00"),
            ("dd.dddd", "+200.00"),
            ("ddmm.mm", "20000.0000"),
            ("ddmm.mm", "-20000.0000"),
            ("ddmm.mm", "03599.1234")
        ]
        for i in invalid_coordinates:
            self.check_invalid_coordinate(i)

    @raises(ValueError)
    def test_latitude_range(self):
        config = {"name": "latitude", "format": "dd.dddd"}
        stdtelem.coordinate(config, "100.00")

    def test_binary_timestamp(self):
        assert stdtelem.binary_timestamp(1349865710) == "10:41:50"
        assert stdtelem.binary_timestamp(70) == "00:01:10"

# 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


    @raises(ValueError)
    def test_wants_config(self):
        stdtelem.coordinate({}, "001.1234")

    @raises(ValueError)
    def check_invalid_coordinate(self, s):
        config = {"format": s[0]}
        stdtelem.coordinate(config, s[1])

    def test_invalid_coordinates(self):
        invalid_coordinates = [
            ("dd.dddd", "asdf"),
            ("dd.dddd", "-200.00"),
            ("dd.dddd", "+200.00"),
            ("ddmm.mm", "20000.0000"),
            ("ddmm.mm", "-20000.0000"),
            ("ddmm.mm", "03599.1234")
        ]
        for i in invalid_coordinates:
            self.check_invalid_coordinate(i)

    @raises(ValueError)
    def test_latitude_range(self):
        config = {"name": "latitude", "format": "dd.dddd"}
        stdtelem.coordinate(config, "100.00")

    def test_binary_timestamp(self):
        assert stdtelem.binary_timestamp(1349865710) == "10:41:50"
        assert stdtelem.binary_timestamp(70) == "00:01:10"

        assert stdtelem.binary_timestamp(3661) == "01:01:01"