Ejemplo n.º 1
0
 def test_remove_lock_unlocked(self):
     """`remove_lock` should raise exception when lock not in use.
     """
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError as e:
         self.assertEqual(e.args[0], 'this lock is not in use')
Ejemplo n.º 2
0
 def setUp(self):
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError:
         pass
     self.my_thing_id = str(uuid.uuid4())
     dweepy.lock(self.my_thing_id, test_lock, test_key)
Ejemplo n.º 3
0
 def tearDown(self):
     self.process.terminate()
     dweepy.unlock(self.my_thing_id, test_key)
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError:
         pass
Ejemplo n.º 4
0
 def setUp(self):
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError:
         pass
     self.my_thing_id = str(uuid.uuid4())
     dweepy.lock(self.my_thing_id, test_lock, test_key)
     self.process = subprocess.Popen('./tests/streamer.sh {0} {1}'.format(self.my_thing_id, test_key), shell=True, stderr=subprocess.STDOUT)
Ejemplo n.º 5
0
 def test_remove_lock_locked(self):
     """`remove_lock` should return a valid response when in use.
     """
     my_thing_id = str(uuid.uuid4())
     dweepy.lock(my_thing_id, test_lock, test_key)
     self.assertEqual(dweepy.remove_lock(test_lock, test_key), test_lock)
Ejemplo n.º 6
0
 def tearDown(self):
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError:
         pass
Ejemplo n.º 7
0
 def setUp(self):
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError:
         pass
Ejemplo n.º 8
0
 def tearDown(self):
     dweepy.unlock(self.my_thing_id, test_key)
     try:
         dweepy.remove_lock(test_lock, test_key)
     except dweepy.DweepyError:
         pass