Exemple #1
0
 def testCreateTag(self):
     '''
     Basic operations of creating, listing and deleting a Tag object
     '''
     client = OlogClient(url=getDefaultTestConfig('url'), username=getDefaultTestConfig('username'), password=getDefaultTestConfig('password'))
     testTag = Tag(name='testTag', state="Active")
     client.createTag(testTag)
     self.assertTrue(testTag in client.listTags(), 'failed to create the testTag')
     client.delete(tagName='testTag')
     self.assertTrue(testTag not in client.listTags(), 'failed to cleanup the testTag')
Exemple #2
0
 def testCreateTag(self):
     '''
     Basic operations of creating, listing and deleting a Tag object
     '''
     client = OlogClient(url='https://localhost:8181/Olog', username='******', password='******')
     testTag = Tag(name='testTag', state="Active")
     client.createTag(testTag)
     self.assertTrue(testTag in client.listTags(), 'failed to create the testTag')
     client.delete(tagName='testTag')
     self.assertTrue(testTag not in client.listTags(), 'failed to cleanup the testTag')
Exemple #3
0
 def testCreateEntryWithTag(self):
     client = OlogClient(url=getDefaultTestConfig('url'), username=getDefaultTestConfig('username'), password=getDefaultTestConfig('password'))
     testLogbook = Logbook(name='testLogbook', owner='testOwner')
     client.createLogbook(testLogbook);
     testTag = Tag(name='testTag')
     client.createTag(testTag)        
     text = 'test python log entry with tag ' + datetime.now().isoformat(' ')
     testLog = LogEntry(text=text,
                        owner='testOwner',
                        logbooks=[testLogbook],
                        tags=[testTag])
     client.log(testLog)
     logEntries = client.find(search=testLog.getText())
     self.assertTrue(len(logEntries) == 1, 'Failed to create log Entry with Tag')
     self.assertTrue(testTag in logEntries[0].getTags(), 'testTag not attached to the testLogEntry1')
     '''cleanup'''
     client.delete(logEntryId=logEntries[0].getId())
     self.assertTrue(len(client.find(search=testLog.getText())) == 0, 'Failed to delete log Entry with Tag')
     client.delete(logbookName=testLogbook.getName())
     self.assertTrue(testLogbook not in client.listLogbooks(), 'failed to cleanup the testLogbook')
     client.delete(tagName=testTag.getName())
     self.assertTrue(testTag not in client.listTags(), 'failed to cleanup the testTag')
     pass