File: test_init.py

package info (click to toggle)
python-aniso8601 10.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 544 kB
  • sloc: python: 7,776; makefile: 3
file content (49 lines) | stat: -rw-r--r-- 1,689 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-

# Copyright (c) 2025, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license.  See the LICENSE file for details.

import unittest

import aniso8601


class TestInitFunctions(unittest.TestCase):
    def test_import(self):
        # Verify the function mappings
        self.assertEqual(aniso8601.parse_datetime, aniso8601.time.parse_datetime)
        self.assertEqual(aniso8601.parse_time, aniso8601.time.parse_time)
        self.assertEqual(
            aniso8601.get_time_resolution, aniso8601.time.get_time_resolution
        )
        self.assertEqual(
            aniso8601.get_datetime_resolution, aniso8601.time.get_datetime_resolution
        )

        self.assertEqual(aniso8601.parse_date, aniso8601.date.parse_date)
        self.assertEqual(
            aniso8601.get_date_resolution, aniso8601.date.get_date_resolution
        )

        self.assertEqual(aniso8601.parse_duration, aniso8601.duration.parse_duration)
        self.assertEqual(
            aniso8601.get_duration_resolution,
            aniso8601.duration.get_duration_resolution,
        )

        self.assertEqual(aniso8601.parse_interval, aniso8601.interval.parse_interval)
        self.assertEqual(
            aniso8601.parse_repeating_interval,
            aniso8601.interval.parse_repeating_interval,
        )
        self.assertEqual(
            aniso8601.get_interval_resolution,
            aniso8601.interval.get_interval_resolution,
        )
        self.assertEqual(
            aniso8601.get_repeating_interval_resolution,
            aniso8601.interval.get_repeating_interval_resolution,
        )