def assert_deb_content(test_case, expected_paths, package_path):
 output_dir = FilePath(test_case.mktemp())
 output_dir.makedirs()
 check_output(['dpkg', '--extract', package_path.path, output_dir.path])
 actual_paths = set()
 for f in output_dir.walk():
  if f.isdir():
   continue
  actual_paths.add(FilePath('/').descendant(f.segmentsFrom(output_dir)))
 test_case.assertEqual(set(), expected_paths.difference(actual_paths))

def assert_deb_content ( test_case , expected_paths , package_path ) : output_dir = FilePath ( test_case . mktemp ( ) ) output_dir . makedirs ( ) check_output ( [ 'dpkg' , '--extract' , package_path . path , output_dir . path ] ) actual_paths = set ( ) for f in output_dir . walk ( ) : if f . isdir ( ) : continue actual_paths . add ( FilePath ( '/' ) . descendant ( f . segmentsFrom ( output_dir ) ) ) test_case . assertEqual ( set ( ) , expected_paths . difference ( actual_paths ) )
fail unless the deb file at package_path contains all the expected_paths .