Changed path() to return absolute path and fixed tests

This commit is contained in:
Rhet Turnbull
2019-11-23 14:48:38 -08:00
parent 243492df88
commit 83186a655d
7 changed files with 35 additions and 24 deletions

View File

@@ -116,15 +116,17 @@ def test_attributes():
assert len(photos) == 1
p = photos[0]
assert p.keywords() == ["Kids"]
assert p.original_filename() == "Pumkins2.jpg"
assert p.filename() == "Pumkins2.jpg"
assert p.date() == datetime.datetime(2018, 9, 28, 16, 7, 7,0,datetime.timezone(datetime.timedelta(seconds=-14400)))
assert p.date() == datetime.datetime(
2018, 9, 28, 16, 7, 7, 0, datetime.timezone(datetime.timedelta(seconds=-14400))
)
assert p.description() == "Girl holding pumpkin"
assert p.name() == "I found one!"
assert p.albums() == ["Pumpkin Farm"]
assert p.persons() == ["Katie"]
assert (
p.path()
== "./tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins2.jpg"
assert p.path().endswith(
"/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins2.jpg"
)
assert p.ismissing() == False