Example #1
0
def test():
    """Verify no-args-behavoiur"""

    write_dnuos_diff("", """
No folders to process.
Type `dnuos -h' for help.
""")
Example #2
0
def test():
    """Verify no-args-behavoiur"""

    write_dnuos_diff("", """
No folders to process.
Type `dnuos -h' for help.
""")
Example #3
0
def test():
    """Verify unknown type functionality"""

    write_dnuos_diff(
        "-qs --unknown-types=txt,text unknown", """
unknown                                             |  128  | Mixe | 0 ~
""")
Example #4
0
def test():
    """Verify --strip functionality"""

    write_dnuos_diff("-qs --output=[n] aac", """
    test1
    test2
    """)
Example #5
0
def test():
    """Verify VBR-only directory filtering functionality"""

    write_dnuos_diff("-q -v mixed", """
Album/Artist                                        |  Size | Type | Quality
============================================================================
""")
Example #6
0
def test():
    """Verify mixed directory exclusion functionality"""

    write_dnuos_diff("-q -M mixed", """
Album/Artist                                        |  Size | Type | Quality
============================================================================
""")
Example #7
0
def test():
    """Verify mixed directory exclusion functionality"""

    write_dnuos_diff(
        "-q -M mixed", """
Album/Artist                                        |  Size | Type | Quality
============================================================================
""")
Example #8
0
def test():
    """Confirm that bad files are ignored"""

    write_dnuos_diff("-q --ignore-bad broken", """
Album/Artist                                        |  Size | Type | Quality
============================================================================

""")
Example #9
0
def test():
    """Verify output tag l"""

    write_dnuos_diff('-q --output=[l] lame/3903-ape', """
Length
======
0:06
    """)
Example #10
0
def test():
    """Verify output tag p"""

    write_dnuos_diff('-q --output=[p] lame/3903-ape', """
Profile
=======
-ape
    """)
Example #11
0
def test():
    """Verify output tag l"""

    write_dnuos_diff('-q --output=[l] lame/3903-ape', """
Length
======
0:06
    """)
Example #12
0
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
""")
Example #13
0
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
""")
Example #14
0
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
""")
Example #15
0
def test():
    """Verify non-LAME filtering functionality"""

    write_dnuos_diff("-ql nonlame", """
Album/Artist                                        |  Size | Type | Quality
============================================================================
nonlame                                             |       |      | 
    lame                                            | 23.3k | MP3  | -V9n
""")
Example #16
0
def test():
    """Confirm that bad files are ignored"""

    write_dnuos_diff(
        "-q --ignore-bad broken", """
Album/Artist                                        |  Size | Type | Quality
============================================================================

""")
Example #17
0
def test():
    """Verify output tag T"""

    write_dnuos_diff('-q --output=[T] aac', """
BR Type
=======

C
C
    """)
Example #18
0
def test():
    """Verify output tag q"""

    write_dnuos_diff('-q --output=[q] aac', """
Quality
=======

96 C
96 C
    """)
Example #19
0
def test():
    """Verify output tag q"""

    write_dnuos_diff('-q --output=[q] aac', """
Quality
=======

96 C
96 C
    """)
Example #20
0
def test():
    """Verify output tag t"""

    write_dnuos_diff('-q -q --output=[t] aac', """
Type
====

AAC
AAC
    """)
Example #21
0
def test():
    """Verify non-LAME filtering functionality"""

    write_dnuos_diff(
        "-ql nonlame", """
Album/Artist                                        |  Size | Type | Quality
============================================================================
nonlame                                             |       |      | 
    lame                                            | 23.3k | MP3  | -V9n
""")
Example #22
0
def test():
    """Verify output tag N"""

    write_dnuos_diff('-q --output=[N] aac', """
Album/Artist
============
aac
test1
test2
    """)
Example #23
0
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
""")
Example #24
0
def test():
    """Verify output tag s"""

    write_dnuos_diff('-q --output=[s] aac', """
Size
====

1.55M
1.55M
    """)
Example #25
0
def test():
    """Verify output tag s"""

    write_dnuos_diff('-q --output=[s] aac', """
Size
====

1.55M
1.55M
    """)
Example #26
0
def test():
    """Verify output tag B"""

    write_dnuos_diff('-q --output=[B] aac', """
Bitrate
=======

96000
96000
    """)
Example #27
0
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
""")
Example #28
0
def test():
    """Verify output tag C"""

    write_dnuos_diff('-q --output=[C] aac', """
Album
=====


jerk
    """)
Example #29
0
def test():
    """Verify --strip functionality"""

    write_dnuos_diff(
        "-qs --output=[n] aac",
        """
    test1
    test2
    """,
    )
Example #30
0
def test():
    """Verify output tag n"""

    write_dnuos_diff('-q --output=[n] aac', """
Album/Artist
============
aac
    test1
    test2
    """)
Example #31
0
def test():
    """Verify output tag b"""

    write_dnuos_diff('-q --output=[b] aac', """
Bitrate
=======

96.0k
96.0k
    """)
Example #32
0
def test():
    """Verify output tag f"""

    write_dnuos_diff('-q --output=[f] aac', """
Files
=====

1
1
    """)
Example #33
0
def test():
    """Verify output tag S"""

    write_dnuos_diff('-q --output=[S] aac', """
Size
====

1622170
1622311
    """)
Example #34
0
def test():
    """Verify output tag f"""

    write_dnuos_diff('-q --output=[f] aac', """
Files
=====

1
1
    """)
Example #35
0
def test():
    """Verify output tag A"""

    write_dnuos_diff('-q --output=[A] aac', """
Artist
======


jerk
    """)
Example #36
0
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
""")
Example #37
0
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
    """)
Example #38
0
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)
Example #39
0
File: case.py Project: s1shed/dnuos
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
""")
Example #40
0
def test():
    """Verify output tag q"""

    write_dnuos_diff('-q --output=[D] walk', """
Depth
=====
0
1
1
2
    """)
Example #41
0
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'))
Example #42
0
def test():
    """Verify output tag q"""

    write_dnuos_diff('-q --output=[D] walk', """
Depth
=====
0
1
1
2
    """)
Example #43
0
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
""")
Example #44
0
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,
""")
Example #45
0
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,
""")
Example #46
0
def test():
    """Verify output tag p"""

    write_dnuos_diff(
        "-q --output=[p] lame/3903-ape",
        """
Profile
=======
-ape
    """,
    )
Example #47
0
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
""")
Example #48
0
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
    """)
Example #49
0
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)
Example #50
0
def test():
    """Verify output tag b"""

    write_dnuos_diff(
        "-q --output=[b] aac",
        """
Bitrate
=======

96.0k
96.0k
    """,
    )
Example #51
0
def test():
    """Verify output tag N"""

    write_dnuos_diff(
        "-q --output=[N] aac",
        """
Album/Artist
============
aac
test1
test2
    """,
    )