beanstalkt / beanstalkt / bt_test.py

Diff from to

beanstalkt/bt_test.py

         # put the job on the queue
         body = 'test job'
         self.btc.put(body, callback=self.stop)
-        jid = self.wait()
-        self.assertIsInstance(jid, int)
+        job_id = self.wait()
+        self.assertIsInstance(job_id, int)
 
         # reserve the job
         self.btc.reserve(callback=self.stop)
         job = self.wait()
         self.assertIsNotNone(job)
-        self.assertEqual(job['jid'], jid)
+        self.assertEqual(job['id'], job_id)
         self.assertEqual(job['body'], body)
 
         # delete the job
-        self.btc.delete(jid, callback=self.stop)
+        self.btc.delete(job_id, callback=self.stop)
         self.wait()
 
     def test_peek_bury_kick(self):
         # put the job on the queue with 1 sec delay
         body = 'test job'
         self.btc.put(body, delay=1, callback=self.stop)
-        jid = self.wait()
+        job_id = self.wait()
 
         def check(job):
             self.assertNotIsInstance(job, Exception)
-            self.assertEqual(job['jid'], jid)
+            self.assertEqual(job['id'], job_id)
             self.assertEqual(job['body'], body)
 
         # peak the next delayed job
         check(self.wait())
 
         # peak the job
-        self.btc.peek(jid, callback=self.stop)
+        self.btc.peek(job_id, callback=self.stop)
         check(self.wait())
 
         # kick the job to ready
-        self.btc.kick_job(jid, callback=self.stop)
+        self.btc.kick_job(job_id, callback=self.stop)
         try:
             self.wait()
         except beanstalkt.UnexpectedResponse as (_, status, __):
         self.btc.reserve(callback=self.stop)
         job = self.wait()
         check(job)
-        self.btc.bury(jid, callback=self.stop)
+        self.btc.bury(job_id, callback=self.stop)
         self.wait()
 
         # peak the next buried job
         self.assertEqual(self.wait(), 1)
 
         # delete the job
-        self.btc.delete(jid, callback=self.stop)
+        self.btc.delete(job_id, callback=self.stop)
         self.wait()
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.