def testDeleteNotification_no_user(self): self.connection= db_connect() self.failstate = False try: del_notification(None, self.connection, None) except: self.failstate = True self.assertTrue(self.failstate)
def testDeleteNotification_no_key(self): self.connection= db_connect() self.user = login(self.connection, '*****@*****.**', 'BlackInk') self.failstate = False try: del_notification(self.user, self.connection, None) except: self.failstate = True self.assertTrue(self.failstate)
def testPostNotification(self): self.connection = db_connect() self.user = login(self.connection, '*****@*****.**', 'BlackInk') self.failstate = False notif = Notification('', 'GOOGL', 0.00, 'Hello World') try: key = post_notification(self.user, self.connection, notif) except ValueError: self.failstate = True self.assertFalse(self.failstate) del_notification(self.user, self.connection, key['name'])
def __deleteNotif(self): row = self._notifList.selected_row_index message = self._notifList.get_value(3, row) for i in self._notifCache: if self._notifCache[i]['message']== message: key= i try: del_notification(self._user, self._connection, key) self._notifList.__sub__(row) except ValueError as error: err= ErrorWin(error) err.parent = self err.show() return
def testDeleteNotification(self): self.connection =db_connect() self.user = login(self.connection, '*****@*****.**', 'BlackInk') self.failstate = False notif = Notification('', 'GOOGL', 0.00, 'Hello World') key= post_notification(self.user, self.connection, notif) notifList = pull_notifications(self.user, self.connection) self.assertNotEqual(notifList, None) for i in notifList: if i == key['name']: try: del_notification(self.user, self.connection, i) except: self.failstate = True self.assertFalse(self.failstate) break