summaryrefslogtreecommitdiff
path: root/contrib/python/podman/test/test_libs.py
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2019-01-09 15:05:58 -0700
committerJhon Honce <jhonce@redhat.com>2019-01-10 11:27:50 -0700
commit45fb935fe44a383ae14f16ab533281687d642c5e (patch)
treef40e0fd8fae389398a5aa6d35888944cde9f03d8 /contrib/python/podman/test/test_libs.py
parent2169b9fe14516b724b257437ed97e32046a4d611 (diff)
downloadpodman-45fb935fe44a383ae14f16ab533281687d642c5e.tar.gz
podman-45fb935fe44a383ae14f16ab533281687d642c5e.tar.bz2
podman-45fb935fe44a383ae14f16ab533281687d642c5e.zip
Move python code from contrib to it's own repo python-podman
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'contrib/python/podman/test/test_libs.py')
-rw-r--r--contrib/python/podman/test/test_libs.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/contrib/python/podman/test/test_libs.py b/contrib/python/podman/test/test_libs.py
deleted file mode 100644
index 202bed1d8..000000000
--- a/contrib/python/podman/test/test_libs.py
+++ /dev/null
@@ -1,53 +0,0 @@
-import datetime
-import unittest
-
-import podman
-
-
-class TestLibs(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def test_parse(self):
- expected = datetime.datetime.strptime(
- '2018-05-08T14:12:53.797795-0700', '%Y-%m-%dT%H:%M:%S.%f%z')
- for v in [
- '2018-05-08T14:12:53.797795191-07:00',
- '2018-05-08T14:12:53.797795-07:00',
- '2018-05-08T14:12:53.797795-0700',
- '2018-05-08 14:12:53.797795191 -0700 MST',
- ]:
- actual = podman.datetime_parse(v)
- self.assertEqual(actual, expected)
-
- expected = datetime.datetime.strptime(
- '2018-05-08T14:12:53.797795-0000', '%Y-%m-%dT%H:%M:%S.%f%z')
- for v in [
- '2018-05-08T14:12:53.797795191Z',
- '2018-05-08T14:12:53.797795191z',
- ]:
- actual = podman.datetime_parse(v)
- self.assertEqual(actual, expected)
-
- actual = podman.datetime_parse(datetime.datetime.now().isoformat())
- self.assertIsNotNone(actual)
-
- def test_parse_fail(self):
- for v in [
- 'There is no time here.',
- ]:
- with self.assertRaises(ValueError):
- podman.datetime_parse(v)
-
- def test_format(self):
- expected = '2018-05-08T18:24:52.753227-07:00'
- dt = podman.datetime_parse(expected)
- actual = podman.datetime_format(dt)
- self.assertEqual(actual, expected)
-
-
-if __name__ == '__main__':
- unittest.main()