Exemplo n.º 1
0
def test_filter_ideas_no_filter():
    ideas = [{'profileid': 5590171, 'profile_title': u'Grants:IdeaLab/Annual training for Administrators, ArbCom, Wikimedia, and Chapter leaders'}, {'profileid': 6487284, 'profile_title': u'Grants:IdeaLab/Code of conduct synchronization'}, {'profileid': 5939165, 'profile_title': u'Grants:IdeaLab/Gender Gap Allies training'}, {'profileid': 5589969, 'profile_title': u'Grants:IdeaLab/Gender gap on the mainpage'}, {'profileid': 5793487, 'profile_title': u'Grants:IdeaLab/Gender-gap admin training'}, {'profileid': 5322427, 'profile_title': u'Grants:IdeaLab/Inspire Grants \u2013 Gender gap campaign'}, {'profileid': 6888558, 'profile_title': u'Grants:IdeaLab/Wikipedia Gender Concerns Reporting Tools'}, {'profileid': 6594508, 'profile_title': u'Grants:IdeaLab/WikiProject Men'}, {'profileid': 6686665, 'profile_title': u'Grants:IdeaLab/WIGI: Wikipedia Gender Index Tools'}]
    assert filter_ideas(ideas, []) == []
Exemplo n.º 2
0
def test_filter_ideas_dicts_missing_profile_title():
    ideas = [{'profileid': 5590171}, {'profileid': 6487284}]
    filter_ideas(ideas, [])
Exemplo n.º 3
0
def test_filter_ideas_ideas_list_of_strings():
    ideas = ['ideas', 'more ideas']
    filter_ideas(ideas, [])
Exemplo n.º 4
0
def test_filter_no_ideas_no_filter():
    assert filter_ideas([], []) == []
Exemplo n.º 5
0
def test_filter_no_ideas():
    ideas = []
    result = filter_ideas(ideas, ['Ideas for the manticore gap'])
    assert result == ideas
Exemplo n.º 6
0
def test_filter_ideas_filter_not_applicable():
    ideas = [{'profileid': 5590171, 'profile_title': u'Grants:IdeaLab/Annual training for Administrators, ArbCom, Wikimedia, and Chapter leaders'}, {'profileid': 6487284, 'profile_title': u'Grants:IdeaLab/Code of conduct synchronization'}]
    filtered_ideas = filter_ideas(ideas, ['Ideas for the manticore gap'])
    assert filtered_ideas == []
Exemplo n.º 7
0
def test_filter_ideas_applicable_filter():
    ideas = [{'profileid': 5590171, 'profile_title': u'Grants:IdeaLab/Annual training for Administrators, ArbCom, Wikimedia, and Chapter leaders'}, {'profileid': 6487284, 'profile_title': u'Grants:IdeaLab/Code of conduct synchronization'}, {'profileid': 5939165, 'profile_title': u'Grants:IdeaLab/Gender Gap Allies training'}, {'profileid': 5589969, 'profile_title': u'Grants:IdeaLab/Gender gap on the mainpage'}, {'profileid': 5793487, 'profile_title': u'Grants:IdeaLab/Gender-gap admin training'}, {'profileid': 5322427, 'profile_title': u'Grants:IdeaLab/Inspire Grants \u2013 Gender gap campaign'}, {'profileid': 6888558, 'profile_title': u'Grants:IdeaLab/Wikipedia Gender Concerns Reporting Tools'}, {'profileid': 6594508, 'profile_title': u'Grants:IdeaLab/WikiProject Men'}, {'profileid': 6686665, 'profile_title': u'Grants:IdeaLab/WIGI: Wikipedia Gender Index Tools'}]

    active_ideas = [u'Grants:IdeaLab/Translation platform: Minority Translate', u'Grants:IdeaLab/Human resources complaint processing best practices', u'Grants:IdeaLab/Code of conduct synchronization', u'Grants:IdeaLab/Investigation about wikimedia projects in Tunisia', u'Grants:IdeaLab/WikiProject Women', u'Grants:IdeaLab/Add Indian Classical Music to Wikipedia', u'Grants:IdeaLab/Human resources sharing in the open movement']
    desired_result = [{'profileid': 6487284, 'profile_title': u'Grants:IdeaLab/Code of conduct synchronization'}]
    assert filter_ideas(ideas, active_ideas) == desired_result