def test_list_noextra(tmpdir): test_mar = tmpdir.join('test.mar') tmpdir.join('hello.txt').write('hello world') tmpdir.join('hello.txt').chmod(0o666) with tmpdir.as_cwd(): cli.do_create(str(test_mar), ['hello.txt'], None) lines = list(cli.do_list(str(test_mar))) assert lines == [ 'SIZE MODE NAME ', '11 0666 hello.txt', ]
def test_list_unknown_extra(mar_sha384, tmpdir): tmpmar = tmpdir.join('test.mar') mar_sha384.copy(tmpmar) with tmpmar.open('r+b') as f: with MarReader(f) as m: offset = m.mardata.additional.offset offset += 8 f.seek(offset) f.write(b'\x12\x34\x56\x78') f.seek(0) text = "\n".join(cli.do_list(str(tmpmar), detailed=True)) assert "Unknown additional data" in text
def test_list_detailed(): text = "\n".join(cli.do_list(TEST_MAR_BZ2, detailed=True)) assert "Product version: 100.0\n" in text assert "\n141 0664 update.manifest\n" in text
def test_list(): text = "\n".join(cli.do_list(TEST_MAR_BZ2)) assert "\n141 0664 update.manifest\n" in text