Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(187)

Unified Diff: tests/parsers/utmp.py

Issue 338460043: [plaso] Refactored timestamp checks in tests #1701 (Closed)
Patch Set: Refactored timestamp checks in tests #1701 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/parsers/systemd_journal.py ('k') | tests/parsers/utmpx.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/parsers/utmp.py
diff --git a/tests/parsers/utmp.py b/tests/parsers/utmp.py
index 740effd688d7c0a23aabc17bf66816009612632b..d4ae3a483c280e47e94bd2004a2982b835d390dd 100644
--- a/tests/parsers/utmp.py
+++ b/tests/parsers/utmp.py
@@ -7,7 +7,6 @@ from __future__ import unicode_literals
import unittest
from plaso.formatters import utmp as _ # pylint: disable=unused-import
-from plaso.lib import timelib
from plaso.parsers import utmp
from tests import test_lib as shared_test_lib
@@ -36,9 +35,7 @@ class UtmpParserTest(test_lib.ParserTestCase):
event = events[2]
- expected_timestamp = timelib.Timestamp.CopyFromString(
- '2013-12-13 14:45:09')
- self.assertEqual(event.timestamp, expected_timestamp)
+ self.CheckTimestamp(event.timestamp, '2013-12-13 14:45:09.000000')
self.assertEqual(event.user, 'LOGIN')
self.assertEqual(event.computer_name, 'localhost')
@@ -62,9 +59,7 @@ class UtmpParserTest(test_lib.ParserTestCase):
event = events[12]
- expected_timestamp = timelib.Timestamp.CopyFromString(
- '2013-12-18 22:46:56.305504')
- self.assertEqual(event.timestamp, expected_timestamp)
+ self.CheckTimestamp(event.timestamp, '2013-12-18 22:46:56.305504')
self.assertEqual(event.user, 'moxilo')
self.assertEqual(event.computer_name, 'localhost')
@@ -98,9 +93,7 @@ class UtmpParserTest(test_lib.ParserTestCase):
event = events[0]
- expected_timestamp = timelib.Timestamp.CopyFromString(
- '2011-12-01 17:36:38.432935')
- self.assertEqual(event.timestamp, expected_timestamp)
+ self.CheckTimestamp(event.timestamp, '2011-12-01 17:36:38.432935')
self.assertEqual(event.user, 'userA')
self.assertEqual(event.computer_name, '10.10.122.1')
« no previous file with comments | « tests/parsers/systemd_journal.py ('k') | tests/parsers/utmpx.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b