Update requests library to 1.2.3
This commit is contained in:
@@ -12,7 +12,7 @@ from django.core.management import call_command
|
||||
from django.conf import settings
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
||||
from requests import put
|
||||
import requests
|
||||
from base64 import encodestring
|
||||
from json import dumps
|
||||
|
||||
@@ -54,12 +54,12 @@ def set_job_status(jobid, passed=True):
|
||||
"""
|
||||
Sets the job status on sauce labs
|
||||
"""
|
||||
body_content = dumps({"passed": passed})
|
||||
config = get_username_and_key()
|
||||
url = 'http://saucelabs.com/rest/v1/{}/jobs/{}'.format(config['username'], world.jobid)
|
||||
body_content = dumps({"passed": passed})
|
||||
base64string = encodestring('{}:{}'.format(config['username'], config['access-key']))[:-1]
|
||||
result = put('http://saucelabs.com/rest/v1/{}/jobs/{}'.format(config['username'], world.jobid),
|
||||
data=body_content,
|
||||
headers={"Authorization": "Basic {}".format(base64string)})
|
||||
headers = {"Authorization": "Basic {}".format(base64string)}
|
||||
result = requests.put(url, data=body_content, headers=headers)
|
||||
return result.status_code == 200
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,8 @@ class XQueueInterface(object):
|
||||
def __init__(self, url, django_auth, requests_auth=None):
|
||||
self.url = url
|
||||
self.auth = django_auth
|
||||
self.session = requests.session(auth=requests_auth)
|
||||
self.session = requests.Session()
|
||||
self.session.auth = requests_auth
|
||||
|
||||
def send_to_queue(self, header, body, files_to_upload=None):
|
||||
"""
|
||||
|
||||
@@ -39,7 +39,7 @@ username = prompt('username on server', 'victor@edx.org')
|
||||
password = prompt('password', 'abc123', safe=True)
|
||||
|
||||
print "get csrf cookie"
|
||||
session = requests.session()
|
||||
session = requests.Session()
|
||||
r = session.get(server + '/')
|
||||
r.raise_for_status()
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class GradingService(object):
|
||||
def __init__(self, config):
|
||||
self.username = config['username']
|
||||
self.password = config['password']
|
||||
self.session = requests.session()
|
||||
self.session = requests.Session()
|
||||
self.system = config['system']
|
||||
|
||||
def _login(self):
|
||||
|
||||
@@ -48,7 +48,7 @@ python-memcached==1.48
|
||||
python-openid==2.2.5
|
||||
pytz==2012h
|
||||
PyYAML==3.10
|
||||
requests==0.14.2
|
||||
requests==1.2.3
|
||||
Shapely==1.2.16
|
||||
sorl-thumbnail==11.12
|
||||
South==0.7.6
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
|
||||
import urlparse
|
||||
from requests.packages.oauthlib.oauth1.rfc5849 import signature
|
||||
import mock
|
||||
import threading
|
||||
import json
|
||||
|
||||
@@ -4,6 +4,7 @@ Unit tests for instructor.api methods.
|
||||
# pylint: disable=E1111
|
||||
import unittest
|
||||
import json
|
||||
import requests
|
||||
from urllib import quote
|
||||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
@@ -756,7 +757,7 @@ class TestInstructorAPIAnalyticsProxy(ModuleStoreTestCase, LoginEnrollmentTestCa
|
||||
class FakeProxyResponse(object):
|
||||
""" Fake successful requests response object. """
|
||||
def __init__(self):
|
||||
self.status_code = instructor.views.api.codes.OK
|
||||
self.status_code = requests.status_codes.codes.OK
|
||||
self.content = '{"test_content": "robot test content"}'
|
||||
|
||||
class FakeBadProxyResponse(object):
|
||||
|
||||
@@ -9,7 +9,6 @@ Many of these GETs may become PUTs in the future.
|
||||
import re
|
||||
import logging
|
||||
import requests
|
||||
from requests.status_codes import codes
|
||||
from collections import OrderedDict
|
||||
from django.conf import settings
|
||||
from django_future.csrf import ensure_csrf_cookie
|
||||
|
||||
@@ -53,7 +53,7 @@ python-memcached==1.48
|
||||
python-openid==2.2.5
|
||||
pytz==2012h
|
||||
PyYAML==3.10
|
||||
requests==0.14.2
|
||||
requests==1.2.3
|
||||
scipy==0.11.0
|
||||
Shapely==1.2.16
|
||||
sorl-thumbnail==11.12
|
||||
|
||||
Reference in New Issue
Block a user