Skip to content
This repository was archived by the owner on Mar 31, 2021. It is now read-only.

Commit 2995f73

Browse files
committed
adjust tests for banned-origins code (bug 1082049)
1 parent 1c076f8 commit 2995f73

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

tests/test_webapp.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import types
55

66
import simplejson as json
7+
from mock import patch
78
from nose.tools import eq_
89

910
from helper import TestCase
@@ -965,14 +966,24 @@ def test_origin_path_trailing_slash(self):
965966
self.assert_failed(with_errors=True)
966967

967968
def test_origin_allowed(self):
968-
self.make_privileged()
969-
self.data["origin"] = "app://marketplace.firefox.com"
970-
self.analyze()
971-
self.assert_silent()
969+
for origin in ("app://marketplace.firefox.com",
970+
"app://gamescentre.mozilla.com",
971+
"app://mozilla.org",
972+
"app://system.gaiamobile.org"):
973+
self.make_privileged()
974+
self.data["origin"] = origin
975+
self.analyze()
976+
self.assert_silent()
972977

978+
@patch("appvalidator.specs.webapps.BANNED_ORIGINS", [
979+
"gamescentre.mozilla.com",
980+
"firefox.com",
981+
])
973982
def test_origin_banned(self):
974-
for origin in ("app://system.gaiamobile.org", "app://mozilla.org"):
975-
self.make_privileged()
983+
self.make_privileged()
984+
985+
for origin in ("app://gamescentre.mozilla.com",
986+
"app://theconsoleisdead.firefox.com"):
976987
self.data["origin"] = origin
977988
self.analyze()
978989
self.assert_failed(with_errors=True)

0 commit comments

Comments
 (0)