コード例 #1
0
ファイル: basic.py プロジェクト: shannonlucas/aerodata
    def __call__(self, tokens):
        """Extracts a datetime from the METAR's timestamp.

        :param Sequence[str] tokens: the sequence of tokens being parsed.

        :return: a tuple containing the datetime (first element) and a sequence
            of the remaining tokens (second element).
        :rtype: (datetime, Sequence)
        """
        m, remainder = TimeStamp._CMD(tokens)
        report = util.guess_date(int(m["day"]), int(m["hour"]),
                                 int(m["minute"]))

        return report, remainder
コード例 #2
0
ファイル: test_util.py プロジェクト: shannonlucas/aerodata
def test_guess_date(day, hour, minute, base, expected):
    actual = util.guess_date(day, hour, minute, base)
    assert actual == expected