def test_doesRecordExist(self): searchFlag = False # Create testMsg = TestMessageModel.messageStr + "exist" dbObj = models.messageModel() dbObj.message(testMsg) # Search indexList = webControl.searchRecords(testMsg) # Compare self.assertTrue(models.messageModel.doesRecordExist(indexList[0]))
def test_message(self): # Write dbObj = models.messageModel() dbObj.message(TestMessageModel.messageStr) # Search and read back indexList = webControl.searchRecords(TestMessageModel.messageStr) dbObj2 = models.messageModel(index=indexList[0]) dbMessageStr = dbObj2.message() self.assertEquals(dbMessageStr, TestMessageModel.messageStr)
def test_deleteRecord(self): # Create message dbObj1 = models.messageModel() dbObj1.message(TestMessageModel.messageStr) # Delete message indexList = webControl.searchRecords(TestMessageModel.messageStr) dbObj3 = models.messageModel(index=indexList[0]) dbObj3.deleteRecord() # Search for "missing" record dbObj = models.messageModel(index=indexList[0]) msgStr = dbObj.message() testStr = "CANNOT FIND MESSAGE @ INDEX" + str(indexList[0]) self.assertEquals(msgStr, testStr)