def test_insert_other_case_mixed(): # If a binary file is added with the same filename as an existing pymodule, # it should not be added toc = TOC(ELEMS1) elem = ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'BINARY') toc.insert(1, elem) expected = list(ELEMS1) assert toc == expected
def test_insert_other_case_pymodule(): # python modules should not use C-I comparisons. Both 'encodings' and # 'EnCodIngs' should be added. toc = TOC(ELEMS1) elem = ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'PYMODULE') toc.insert(1, elem) expected = list(ELEMS1) expected.insert(1, elem) assert toc == expected
def test_insert_other_case_pymodule(): # python modules should not use C-I comparisons. Both 'encodings' and # 'EnCodIngs' should be added. toc = TOC(ELEMS1) elem = ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'PYMODULE') toc.insert(1, elem) expected = list(ELEMS1) expected.insert(1, elem) assert toc == expected
def test_insert_other_case_mixed(): # If a binary file is added with the same filename as an existing pymodule, # it should not be added toc = TOC(ELEMS1) elem = ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'BINARY') toc.insert(1, elem) expected = list(ELEMS1) assert toc == expected
def test_insert_keep_filename(): # name in TOC should be the same as the one added toc = TOC() entry = ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'BINARY') toc.insert(1, entry) assert toc[0][0] == entry[0]
def test_insert_existing(): toc = TOC(ELEMS1) toc.insert(0, ELEMS1[-1]) toc.insert(1, ELEMS1[-1]) expected = list(ELEMS1) assert toc == expected
def test_insert(): toc = TOC(ELEMS1) toc.insert(1, ('li-la-lu', '/home/myself/li-la-su', 'SOMETHING')) expected = list(ELEMS1) expected.insert(1, ('li-la-lu', '/home/myself/li-la-su', 'SOMETHING')) assert toc == expected
def test_insert_other_case_binary(): # binary files should use C-I comparisons. 'LiBrEADlInE.so.6' should not be added. toc = TOC(ELEMS1) toc.insert(1, ('LiBrEADlInE.so.6', '/lib64/libreadline.so.6', 'BINARY')) expected = list(ELEMS1) assert toc == expected
def test_insert_keep_filename(): # name in TOC should be the same as the one added toc = TOC() entry = ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'BINARY') toc.insert(1, entry) assert toc[0][0] == entry[0]
def test_insert_existing(): toc = TOC(ELEMS1) toc.insert(0, ELEMS1[-1]) toc.insert(1, ELEMS1[-1]) expected = list(ELEMS1) assert toc == expected
def test_insert(): toc = TOC(ELEMS1) toc.insert(1, ('li-la-lu', '/home/myself/li-la-su', 'SOMETHING')) expected = list(ELEMS1) expected.insert(1, ('li-la-lu', '/home/myself/li-la-su', 'SOMETHING')) assert toc == expected
def test_insert_other_case_binary(): # binary files should use C-I comparisons. 'LiBrEADlInE.so.6' should not be added. toc = TOC(ELEMS1) toc.insert(1, ('LiBrEADlInE.so.6', '/lib64/libreadline.so.6', 'BINARY')) expected = list(ELEMS1) assert toc == expected
def test_insert_other_case(): # should not be added if the filenames are the same on a case-insensitive system. toc = TOC(ELEMS1) toc.insert(1, ('EnCodIngs', '/usr/lib/python2.7/encodings.py', 'BINARY')) expected = list(ELEMS1) assert toc == expected