-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code review: 228160043: Added more formatter tests for issue #99.
- Loading branch information
1 parent
446ee1e
commit ad32f96
Showing
42 changed files
with
867 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the default event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import default | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class DefaultFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the default event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = default.DefaultFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = default.DefaultFormatter() | ||
|
||
expected_attribute_names = [u'attribute_driven'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the Skype main database event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import skype | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class SkypeAccountFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the Skype account event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = skype.SkypeAccountFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = skype.SkypeAccountFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'username', | ||
u'email', | ||
u'country'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
class SkypeChatFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the Skype chat event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = skype.SkypeChatFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = skype.SkypeChatFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'from_account', | ||
u'to_account', | ||
u'title', | ||
u'text'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
class SkypeSMSFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the Skype SMS event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = skype.SkypeSMSFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = skype.SkypeSMSFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'number', | ||
u'text'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
class SkypeCallFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the Skype call event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = skype.SkypeCallFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = skype.SkypeCallFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'src_call', | ||
u'dst_call', | ||
u'call_type'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
class SkypeTransferFileFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the Skype transfer file event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = skype.SkypeTransferFileFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = skype.SkypeTransferFileFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'source', | ||
u'destination', | ||
u'transferred_filename', | ||
u'action_type'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.