@@ -386,7 +386,25 @@ class ProjectInfo(AlbumInfo):
|
|||||||
Projects are cards, calendars, slideshows, etc.
|
Projects are cards, calendars, slideshows, etc.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
...
|
@property
|
||||||
|
def folder_names(self):
|
||||||
|
"""Return hierarchical list of folders the album is contained in
|
||||||
|
the folder list is in form:
|
||||||
|
["Top level folder", "sub folder 1", "sub folder 2", ...]
|
||||||
|
or empty list if album is not in any folders
|
||||||
|
"""
|
||||||
|
|
||||||
|
# projects are not in folders
|
||||||
|
return []
|
||||||
|
|
||||||
|
@property
|
||||||
|
def folder_list(self):
|
||||||
|
"""Returns list of FolderInfo objects for each folder the album is contained in
|
||||||
|
or empty list if album is not in any folders
|
||||||
|
"""
|
||||||
|
|
||||||
|
# projects are not in folders
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
class FolderInfo:
|
class FolderInfo:
|
||||||
|
|||||||
@@ -149,3 +149,11 @@ def test_photoinfo_project_info(photosdb, uuid, expected_projects):
|
|||||||
|
|
||||||
project_names = [p.title for p in photo.project_info]
|
project_names = [p.title for p in photo.project_info]
|
||||||
assert sorted(project_names) == sorted(expected_projects)
|
assert sorted(project_names) == sorted(expected_projects)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("uuid,expected_projects", PHOTO_PROJECTS.items())
|
||||||
|
def test_photoinfo_project_info_asdict(photosdb, uuid, expected_projects):
|
||||||
|
"""Test PhotoInfo.project_info.asdict() #999"""
|
||||||
|
photo = photosdb.get_photo(uuid)
|
||||||
|
for p in photo.project_info:
|
||||||
|
assert p.asdict()
|
||||||
|
|||||||
Reference in New Issue
Block a user