Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
 def fetch(rjcode):
     work = workinfo.Work(rjcode, 'name', 'group')
     work.series = 'series'
     return work
Ejemplo n.º 4
0
def test_work_path_slash():
    obj = workinfo.Work('RJ123', 'foo', 'bar/')
    assert workinfo.work_path(obj) == Path('bar_/RJ123 foo')
Ejemplo n.º 5
0
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')
Ejemplo n.º 6
0
def test_work_filename_slash():
    obj = workinfo.Work('RJ123', 'foo/', 'bar')
    assert workinfo.work_filename(obj) == 'RJ123 [bar] foo_'