def test_404_after_remove_alert(self): """`get_alert` should raise an exception if alert does not exist """ dweepy.set_alert( self.my_thing_id, ['*****@*****.**', '*****@*****.**'], test_alert_condition, test_key, ) dweepy.remove_alert(self.my_thing_id, test_key) try: dweepy.get_alert(self.my_thing_id, test_key) except dweepy.DweepyError as e: self.assertEqual(e.args[0], 'we couldn\'t find this') else: self.fail("shouldn't ever get called")
def test_get_alert(self): """`get_alert` should return a valid response """ dweepy.set_alert( self.my_thing_id, ['*****@*****.**', '*****@*****.**'], test_alert_condition, test_key, ) alert = dweepy.get_alert(self.my_thing_id, test_key) self.assertEqual(alert['condition'], test_alert_condition)