Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed typos.

  • Loading branch information...
commit 417306a90beeb07c7c7a111b66c20486703d22c4 1 parent e87d08b
@paddyforan paddyforan authored
Showing with 7 additions and 6 deletions.
  1. +4 −3 iron_worker/iron_worker.py
  2. +3 −3 test.py
View
7 iron_worker/iron_worker.py
@@ -5,6 +5,7 @@
from poster.streaminghttp import register_openers
import zipfile
import ConfigParser
+import time
import iron_rest
try:
import json
@@ -88,7 +89,7 @@ def __init__(self, token=None, project_id=None, host=AWS_HOST,
self.client = iron_rest.IronClient(name=IronWorker.NAME,
version=IronWorker.VERSION, host=self.host,
project_id=self.project_id, port=self.port,
- token=self.project_id, protocol=self.protocol,
+ token=self.token, protocol=self.protocol,
api_version=IronWorker.API_VERSION)
@staticmethod
@@ -128,7 +129,7 @@ def getTasks(self):
return it.
"""
resp = self.client.get("tasks")
- tasks = json.loads(body["body"])
+ tasks = json.loads(resp["body"])
return tasks['tasks']
def getTaskDetails(self, task_id):
@@ -194,7 +195,7 @@ def postCode(self, name, runFilename, zipFilename):
"data": data
})
- resp = self.client.post(url="code", body=str().join(datagen),
+ resp = self.client.post(url="codes", body=str().join(datagen),
headers=headers)
return json.loads(resp['body'])
View
6 test.py
@@ -119,7 +119,7 @@ def test_postSchedule(self):
for schedule in schedules:
schedule_ids.append(schedule['id'])
- self.assertIn(schedule_id, schedule_ids)
+ self.assertIn(schedule_id[0]["id"], schedule_ids)
def test_postScheduleAndPayload(self):
schedule_id = self.worker.postSchedule(name=self.code_name, delay=120,
@@ -130,7 +130,7 @@ def test_postScheduleAndPayload(self):
for schedule in schedules:
schedule_ids.append(schedule['id'])
- self.assertIn(schedule_id, schedule_ids)
+ self.assertIn(schedule_id[0]["id"], schedule_ids)
def test_postAdvancedSchedule(self):
start_at = time.gmtime(time.time() + 3600) # one hour from now
@@ -145,7 +145,7 @@ def test_postAdvancedSchedule(self):
for schedule in schedules:
schedule_ids.append(schedule['id'])
- self.assertIn(schedule_id, schedule_ids)
+ self.assertIn(schedule_id[0]["id"], schedule_ids)
def test_cancelSchedule(self):
schedules = self.worker.getSchedules()
Please sign in to comment.
Something went wrong with that request. Please try again.