Esempio n. 1
0
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
Esempio n. 2
0
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]
Esempio n. 3
0
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
Esempio n. 4
0
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]
Esempio n. 5
0
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
Esempio n. 6
0
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
    ]
Esempio n. 7
0
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