forked from markdoliner/flickrmirrorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
29 lines (22 loc) · 807 Bytes
/
tests.py
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
from .flickrmirrorer import get_timestamp
def test_unparseable_title_timestamp():
timestamp = get_timestamp({
'datetakenunknown': '1',
'datetaken': '2014-10-01 13:45:37',
'title': 'flaskpost'
})
# Fall back on datetaken if we can't parse the date from the title
assert timestamp.isoformat() == "2014-10-01T13:45:37"
def test_plain_title_timestamp():
timestamp = get_timestamp({
'datetakenunknown': '1',
'datetaken': '2014-10-01 13:45:37',
'title': '20151130_135610'
})
assert timestamp.isoformat() == "2015-11-30T13:56:10"
def test_known_timestamp():
timestamp = get_timestamp({
'datetakenunknown': '0',
'datetaken': '2015-11-02 12:35:07'
})
assert timestamp.isoformat() == "2015-11-02T12:35:07"