Skip to content

Commit

Permalink
Fix #533 Testing untriaged issues filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
karlcow committed Jan 13, 2015
1 parent 94aa905 commit 80c09f3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
sys.path.append(os.path.realpath(os.pardir))
import webcompat

from webcompat.issues import filter_untriaged

# Any request that depends on parsing HTTP Headers (basically anything
# on the index route, will need to include the following: environ_base=headers
headers = {'HTTP_USER_AGENT': ('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; '
Expand Down Expand Up @@ -79,6 +81,30 @@ def test_issues_list_page(self):
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307)

def test_issues_untriaged(self):
'''Test that the untriaged filtering is correct.'''
issues = [
{u'labels': [{u'name': u'bug'}, {u'name': u'help wanted'}],
u'title': u"fake bug 0",
u'id': 0},
{u'labels': [],
u'title': u"fake bug 1",
u'id': 1},
{u'labels': [{u'name': u'contactready'}],
u'title': u"fake bug 2",
u'id': 2},
{u'labels': [{u'name': u'needsdiagnosis'}],
u'title': u"fake bug 3",
u'id': 3},
{u'labels': [{u'name': u'needscontact'}],
u'title': u"fake bug 4",
u'id': 4},
{u'labels': [{u'name': u'sitewait'}],
u'title': u"fake bug 5",
u'id': 5}]
result = '[{"labels": [{"name": "bug"}, {"name": "help wanted"}], "id": 0, "title": "fake bug 0"}, {"labels": [], "id": 1, "title": "fake bug 1"}]'
self.assertEqual(filter_untriaged(issues), result)


if __name__ == '__main__':
unittest.main()

0 comments on commit 80c09f3

Please sign in to comment.