def test(): """Verify no-args-behavoiur""" write_dnuos_diff("", """ No folders to process. Type `dnuos -h' for help. """)
def test(): """Verify unknown type functionality""" write_dnuos_diff( "-qs --unknown-types=txt,text unknown", """ unknown | 128 | Mixe | 0 ~ """)
def test(): """Verify --strip functionality""" write_dnuos_diff("-qs --output=[n] aac", """ test1 test2 """)
def test(): """Verify VBR-only directory filtering functionality""" write_dnuos_diff("-q -v mixed", """ Album/Artist | Size | Type | Quality ============================================================================ """)
def test(): """Verify mixed directory exclusion functionality""" write_dnuos_diff("-q -M mixed", """ Album/Artist | Size | Type | Quality ============================================================================ """)
def test(): """Verify mixed directory exclusion functionality""" write_dnuos_diff( "-q -M mixed", """ Album/Artist | Size | Type | Quality ============================================================================ """)
def test(): """Confirm that bad files are ignored""" write_dnuos_diff("-q --ignore-bad broken", """ Album/Artist | Size | Type | Quality ============================================================================ """)
def test(): """Verify output tag l""" write_dnuos_diff('-q --output=[l] lame/3903-ape', """ Length ====== 0:06 """)
def test(): """Verify output tag p""" write_dnuos_diff('-q --output=[p] lame/3903-ape', """ Profile ======= -ape """)
def test(): """Verify directory exclusion functionality""" write_dnuos_diff("-q --exclude=aac/test1 aac", """ Album/Artist | Size | Type | Quality ============================================================================ aac | | | test2 | 1.55M | AAC | 96 C """)
def test(): """Verify ID3 version preference functionality""" write_dnuos_diff("-qs --prefer-tag=2 --output=[A] id3", """ Red """) write_dnuos_diff("-qs --prefer-tag=1 --output=[A] id3", """ Blue """)
def test(): """Verify non-LAME filtering functionality""" write_dnuos_diff("-ql nonlame", """ Album/Artist | Size | Type | Quality ============================================================================ nonlame | | | lame | 23.3k | MP3 | -V9n """)
def test(): """Confirm that bad files are ignored""" write_dnuos_diff( "-q --ignore-bad broken", """ Album/Artist | Size | Type | Quality ============================================================================ """)
def test(): """Verify output tag T""" write_dnuos_diff('-q --output=[T] aac', """ BR Type ======= C C """)
def test(): """Verify output tag q""" write_dnuos_diff('-q --output=[q] aac', """ Quality ======= 96 C 96 C """)
def test(): """Verify output tag t""" write_dnuos_diff('-q -q --output=[t] aac', """ Type ==== AAC AAC """)
def test(): """Verify non-LAME filtering functionality""" write_dnuos_diff( "-ql nonlame", """ Album/Artist | Size | Type | Quality ============================================================================ nonlame | | | lame | 23.3k | MP3 | -V9n """)
def test(): """Verify output tag N""" write_dnuos_diff('-q --output=[N] aac', """ Album/Artist ============ aac test1 test2 """)
def test(): """Verify custom indentation functionality""" write_dnuos_diff("-q --indent=1 aac", """ Album/Artist | Size | Type | Quality ============================================================================ aac | | | test1 | 1.55M | AAC | 96 C test2 | 1.55M | AAC | 96 C """)
def test(): """Verify output tag s""" write_dnuos_diff('-q --output=[s] aac', """ Size ==== 1.55M 1.55M """)
def test(): """Verify output tag B""" write_dnuos_diff('-q --output=[B] aac', """ Bitrate ======= 96000 96000 """)
def test(): """Verify directory exclusion functionality""" write_dnuos_diff( "-q --exclude=aac/test1 aac", """ Album/Artist | Size | Type | Quality ============================================================================ aac | | | test2 | 1.55M | AAC | 96 C """)
def test(): """Verify output tag C""" write_dnuos_diff('-q --output=[C] aac', """ Album ===== jerk """)
def test(): """Verify --strip functionality""" write_dnuos_diff( "-qs --output=[n] aac", """ test1 test2 """, )
def test(): """Verify output tag n""" write_dnuos_diff('-q --output=[n] aac', """ Album/Artist ============ aac test1 test2 """)
def test(): """Verify output tag b""" write_dnuos_diff('-q --output=[b] aac', """ Bitrate ======= 96.0k 96.0k """)
def test(): """Verify output tag f""" write_dnuos_diff('-q --output=[f] aac', """ Files ===== 1 1 """)
def test(): """Verify output tag S""" write_dnuos_diff('-q --output=[S] aac', """ Size ==== 1622170 1622311 """)
def test(): """Verify output tag A""" write_dnuos_diff('-q --output=[A] aac', """ Artist ====== jerk """)
def test(): """Verify custom indentation functionality""" write_dnuos_diff( "-q --indent=1 aac", """ Album/Artist | Size | Type | Quality ============================================================================ aac | | | test1 | 1.55M | AAC | 96 C test2 | 1.55M | AAC | 96 C """)
def test(): """Verifies basedirs are automatically excluded from ancestor basedirs""" write_dnuos_diff("-q walk walk/inner", """ Album/Artist | Size | Type | Quality ============================================================================ walk | | | b | 146k | MP3 | -apfe inner | | | a | 131k | MP3 | -ape """)
def test(): """Verify wildcard expansion""" write_dnuos_diff("-q -w c*", """ Album/Artist | Size | Type | Quality ============================================================================ case | | | B | 146k | MP3 | -apfe a | 131k | MP3 | -ape c | 125k | MP3 | -apfs """, no_glob=True)
def test(): """Verifies case insensitive sorting with the -i flag""" write_dnuos_diff("-qi case", """ Album/Artist | Size | Type | Quality ============================================================================ case | | | a | 131k | MP3 | -ape B | 146k | MP3 | -apfe c | 125k | MP3 | -apfs """)
def test(): """Verify output tag q""" write_dnuos_diff('-q --output=[D] walk', """ Depth ===== 0 1 1 2 """)
def test(): """Confirm that broken audio files are correctly reported""" testdata_dir = os.environ['DATA_DIR'] write_dnuos_diff("-q broken", """ Album/Artist | Size | Type | Quality ============================================================================ Audiotype failed on the following files: %s """ % os.path.join(testdata_dir, 'broken', 'broken.mp3'))
def test(): """Verify minimum MP3 bitrate functionality""" write_dnuos_diff("-q --bitrate=320 lame", """ Album/Artist | Size | Type | Quality ============================================================================ lame | | | 3903-api | 237k | MP3 | -api 3961-api | 237k | MP3 | -b 320 3970b1-b320 | 237k | MP3 | -b 320 """)
def test(): """Verify individual file listing functionality""" write_dnuos_diff("-qs -L --output=[n],[a],[A],[b],[C],[f],[l],[L],[p]," "[q],[s],[t],[T],[V] nonlame", """ lame,VBR,,15.7k,,1,0:12,12,-V9n,-V9n,23.3k,MP3,V,LAME3.97b 397b1-v9-vbrnew.mp3,VBR,,15.7k,,1,0:12,12,-V9n,-V9n,23.3k,MP3,V,LAME3.97b twolame,8,,8.00k,,1,0:24,24,,8 C,23.6k,MP3,C, twolame.mp3,8,,8.00k,,1,0:24,24,,8 C,23.6k,MP3,C, """)
def test(): """Verify individual file listing functionality""" write_dnuos_diff( "-qs -L --output=[n],[a],[A],[b],[C],[f],[l],[L],[p]," "[q],[s],[t],[T],[V] nonlame", """ lame,VBR,,15.7k,,1,0:12,12,-V9n,-V9n,23.3k,MP3,V,LAME3.97b 397b1-v9-vbrnew.mp3,VBR,,15.7k,,1,0:12,12,-V9n,-V9n,23.3k,MP3,V,LAME3.97b twolame,8,,8.00k,,1,0:24,24,,8 C,23.6k,MP3,C, twolame.mp3,8,,8.00k,,1,0:24,24,,8 C,23.6k,MP3,C, """)
def test(): """Verify output tag p""" write_dnuos_diff( "-q --output=[p] lame/3903-ape", """ Profile ======= -ape """, )
def test(): """Verify minimum MP3 bitrate functionality""" write_dnuos_diff( "-q --bitrate=320 lame", """ Album/Artist | Size | Type | Quality ============================================================================ lame | | | 3903-api | 237k | MP3 | -api 3961-api | 237k | MP3 | -b 320 3970b1-b320 | 237k | MP3 | -b 320 """)
def test(): """Verifies basedirs are automatically excluded from ancestor basedirs""" write_dnuos_diff( "-q walk walk/inner", """ Album/Artist | Size | Type | Quality ============================================================================ walk | | | b | 146k | MP3 | -apfe inner | | | a | 131k | MP3 | -ape """)
def test(): """Verify output tag b""" write_dnuos_diff( "-q --output=[b] aac", """ Bitrate ======= 96.0k 96.0k """, )
def test(): """Verify output tag N""" write_dnuos_diff( "-q --output=[N] aac", """ Album/Artist ============ aac test1 test2 """, )