def test_mfsa_id_from_filename(): eq_(mfsa_id_from_filename('announce/2014/mfsa2014-01.md'), '2014-01') eq_(mfsa_id_from_filename('announce/2014/mfsa2014-101.md'), '2014-101') assert mfsa_id_from_filename('dude.txt') is None
def get_ids_from_files(filenames): ids = [mfsa_id_from_filename(fn) for fn in filenames] # filter any Nones return [mfsa_id for mfsa_id in ids if mfsa_id]
def test_mfsa_id_from_filename(): eq_(mfsa_id_from_filename('announce/2014/mfsa2014-01.md'), '2014-01') eq_(mfsa_id_from_filename('announce/2014/mfsa2014-101.md'), '2014-101') eq_(mfsa_id_from_filename('announce/2016/mfsa2016-42.yml'), '2016-42') assert mfsa_id_from_filename('dude.txt') is None
def filter_updated_from_deleted(modified_files, deleted_files): mod_file_ids = get_ids_from_files(modified_files) return [fn for fn in deleted_files if mfsa_id_from_filename(fn) not in mod_file_ids]
def test_mfsa_id_from_filename(): assert mfsa_id_from_filename('announce/2014/mfsa2014-01.md') == '2014-01' assert mfsa_id_from_filename('announce/2014/mfsa2014-101.md') == '2014-101' assert mfsa_id_from_filename('announce/2016/mfsa2016-42.yml') == '2016-42' assert mfsa_id_from_filename('dude.txt') is None
def filter_updated_from_deleted(modified_files, deleted_files): mod_file_ids = get_ids_from_files(modified_files) return [ fn for fn in deleted_files if mfsa_id_from_filename(fn) not in mod_file_ids ]
def test_mfsa_id_from_filename(): assert mfsa_id_from_filename("announce/2014/mfsa2014-01.md") == "2014-01" assert mfsa_id_from_filename("announce/2014/mfsa2014-101.md") == "2014-101" assert mfsa_id_from_filename("announce/2016/mfsa2016-42.yml") == "2016-42" assert mfsa_id_from_filename("dude.txt") is None