adapt tests, correct docstrings

This commit is contained in:
Dorian Soergel 2019-05-31 17:52:39 +02:00
parent 638e9d5dc8
commit acf447b4b0
2 changed files with 7 additions and 6 deletions

View file

@ -26,7 +26,8 @@ import musicbrainzngs
def work_father_id(mb_workid, work_date=None):
""" Given a mb_workid, find the id one of the works the work is part of"""
""" Given a mb_workid, find the id one of the works the work is part of
and the first composition date it encounters. """
work_info = musicbrainzngs.get_work_by_id(mb_workid,
includes=["work-rels",
"artist-rels"])
@ -46,7 +47,7 @@ def work_father_id(mb_workid, work_date=None):
def work_parent_id(mb_workid):
"""Find the parentwork id of a work given its id. """
"""Find the parentwork id and composition date of a work given its id. """
work_date = None
while True:
new_mb_workid, work_date = work_father_id(mb_workid, work_date)
@ -57,8 +58,8 @@ def work_parent_id(mb_workid):
def find_parentwork_info(mb_workid):
"""Return the work relationships (dict) of a parentwork given the id of
the work"""
"""Return the work relationships (dict) and composition date of a
parentwork given the id of the work"""
parent_id, work_date = work_parent_id(mb_workid)
work_info = musicbrainzngs.get_work_by_id(parent_id,
includes=["artist-rels"])

View file

@ -80,9 +80,9 @@ class ParentWorkTest(unittest.TestCase, TestHelper):
def test_father_work(self, command_output):
mb_workid = u'2e4a3668-458d-3b2a-8be2-0b08e0d8243a'
self.assertEqual(u'f04b42df-7251-4d86-a5ee-67cfa49580d1',
parentwork.work_father(mb_workid)[0])
parentwork.work_father_id(mb_workid)[0])
self.assertEqual(u'45afb3b2-18ac-4187-bc72-beb1b1c194ba',
parentwork.work_parent(mb_workid)[0])
parentwork.work_parent_id(mb_workid)[0])
def suite():