def test_work_repr(): work = workinfo.Work('RJ123', 'foo', 'bar') got = repr(work) assert repr('RJ123') in got assert repr('foo') in got assert repr('bar') in got assert type(work).__qualname__ in got
def fetch(rjcode): work = workinfo.Work(rjcode, 'name', 'group') work.series = 'series' work.description = '''\ Some text Other text ''' work.tracklist = [ Track('1. foo', 'bar'), Track('2. spam', 'eggs'), ] return work
def fetch(rjcode): work = workinfo.Work(rjcode, 'name', 'group') work.series = 'series' return work
def test_work_path_slash(): obj = workinfo.Work('RJ123', 'foo', 'bar/') assert workinfo.work_path(obj) == Path('bar_/RJ123 foo')
def test_work_path_with_series(): obj = workinfo.Work('RJ123', 'foo', 'bar') obj.series = 'baz' assert workinfo.work_path(obj) == Path('bar/baz/RJ123 foo')
def test_work_filename_slash(): obj = workinfo.Work('RJ123', 'foo/', 'bar') assert workinfo.work_filename(obj) == 'RJ123 [bar] foo_'