diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_json.py | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_json.py b/tests/test_json.py index 82a2a3d07..de2914182 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1,11 +1,11 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- +import json +import logging  import urllib  import urllib2 -from json import loads -from logging import log  url = "http://localhost:8001/api/%s" @@ -16,18 +16,18 @@ class TestJson(object):          if not post: post = {}          post['session'] = self.key          u = urllib2.urlopen(url % name, data=urlencode(post)) -        return loads(u.read()) +        return json.loads(u.read())      def setUp(self):          u = urllib2.urlopen(url % "login", data=urlencode({"username": "TestUser", "password": "pwhere"})) -        self.key = loads(u.read()) +        self.key = json.loads(u.read())          assert self.key is not False      def test_wronglogin(self):          u = urllib2.urlopen(url % "login", data=urlencode({"username": "crap", "password": "wrongpw"})) -        assert loads(u.read()) is False +        assert json.loads(u.read()) is False      def test_access(self): @@ -41,7 +41,7 @@ class TestJson(object):      def test_status(self):          ret = self.call("statusServer") -        log(1, str(ret)) +        logging.log(1, str(ret))          assert "pause" in ret          assert "queue" in ret  | 
