Fixed the policy tests in Python 3

The file builtin was removed in Python 3. open should be used instead.

bp python3

Change-Id: Ib394b9ceeffb1ae8fd4cbebbd0818c64e24e55e6
This commit is contained in:
David Stanek 2014-03-31 02:18:49 +00:00
parent 410ddb826f
commit 3ec0c5e693
2 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,7 @@ class DefaultPolicyTestCase(tests.TestCase):
class PolicyJsonTestCase(tests.TestCase):
def _load_entries(self, filename):
return set(json.load(file(filename)))
return set(json.load(open(filename)))
def test_json_examples_have_matching_entries(self):
policy_keys = self._load_entries(tests.dirs.etc('policy.json'))

View File

@ -20,6 +20,7 @@ commands =
nosetests \
keystone/tests/test_cache_backend_mongo.py \
keystone/tests/test_injection.py \
keystone/tests/test_policy.py \
keystone/tests/test_singular_plural.py \
keystone/tests/test_sizelimit.py \
keystone/tests/unit