def test_trace_nonexisting_file(): files = ["/is/not/there/"] manager = DebTracer() packages, unknown_files = manager.identify_packages_from_files(files) # get_details_for_packages doesn't fail on an empty package list. assert not packages packages = manager.get_details_for_packages(packages) assert not packages
def test_utf8_file(): files = [ u"/usr/share/ca-certificates/mozilla/" u"TÜBİTAK_UEKAE_Kök_Sertifika_Hizmet_Sağlayıcısı_-_Sürüm_3.crt" ] manager = DebTracer() # Simple sanity check that the pipeline works with utf-8 (packages, unknown_files) = \ manager.identify_packages_from_files(files) packages = manager.get_details_for_packages(packages) # If the file exists, it should be in ca-certificates if os.path.isfile(files[0]): assert packages[0].name == "ca-certificates" else: # Otherwise just make sure we didn't throw an exception assert True