forked from pe-st/garmin-connect-export
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_gcexport.py
23 lines (16 loc) · 887 Bytes
/
test_gcexport.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from unittest import TestCase
from gcexport import resolve_path
class Tests(TestCase):
def test_resolve_path_1(self):
actual = resolve_path("root", "sub/{YYYY}", "2018-03-08 12:23:22")
self.assertEqual("root/sub/2018", actual)
actual = resolve_path("root", "sub/{MM}", "2018-03-08 12:23:22")
self.assertEqual("root/sub/03", actual)
actual = resolve_path("root", "sub/{YYYY}/{MM}", "2018-03-08 12:23:22")
self.assertEqual("root/sub/2018/03", actual)
actual = resolve_path("root", "sub/{yyyy}", "2018-03-08 12:23:22")
self.assertEqual("root/sub/{yyyy}", actual)
actual = resolve_path("root", "sub/{YYYYMM}", "2018-03-08 12:23:22")
self.assertEqual("root/sub/{YYYYMM}", actual)
actual = resolve_path("root", "sub/all", "2018-03-08 12:23:22")
self.assertEqual("root/sub/all", actual)