def test_keep_file(self): f = sample_data.file() assert self.utils._keep_file(True, FilterAction.INCLUDE) assert not self.utils._keep_file(True, FilterAction.EXCLUDE) assert not self.utils._keep_file(False, FilterAction.INCLUDE) assert self.utils._keep_file(False, FilterAction.EXCLUDE)
def test_extract_license(self): f = sample_data.file() fl = self.utils._extract_license(f) expected_l = {'gpl-3.0-or-later', 'gpl-2.0-or-later'} assert expected_l == fl
def test_extract_license(self): lic = self.utils._extract_license(sample_data.file()) assert lic == \ {"gpl-2.0-or-later", "gpl-3.0-or-later"} or \ {"gpl-3.0-or-later", "gpl-2.0-or-later"}
def test_isdir(self): assert not self.utils._isdir(sample_data.file()) assert self.utils._isdir(sample_data.dir())