def test_remove_lock_unlocked(self): """`remove_lock` should raise exception when lock not in use. """ try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError as e: self.assertEqual(e.args[0], 'this lock is not in use')
def setUp(self): try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError: pass self.my_thing_id = str(uuid.uuid4()) ts_dweepy.lock(self.my_thing_id, test_lock, test_key)
def tearDown(self): self.process.terminate() ts_dweepy.unlock(self.my_thing_id, test_key) try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError: pass
def setUp(self): try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError: pass self.my_thing_id = str(uuid.uuid4()) ts_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)
def test_remove_lock_locked(self): """`remove_lock` should return a valid response when in use. """ my_thing_id = str(uuid.uuid4()) ts_dweepy.lock(my_thing_id, test_lock, test_key) self.assertEqual(ts_dweepy.remove_lock(test_lock, test_key), test_lock)
def tearDown(self): try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError: pass
def setUp(self): try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError: pass
def tearDown(self): ts_dweepy.unlock(self.my_thing_id, test_key) try: ts_dweepy.remove_lock(test_lock, test_key) except ts_dweepy.DweepyError: pass