aboutsummaryrefslogtreecommitdiff
path: root/tests/test_base.py
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2016-03-07 18:35:01 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2016-03-07 18:35:01 +0000
commitcb53daadd0e199791871c1d261b160b6ea02030d (patch)
treeb8457784bf49cd7a697e043514136637cee2bf45 /tests/test_base.py
parentd9cdc2b52f69d47529b86de41c7cc8e9ef53745a (diff)
downloadtrappy-cb53daadd0e199791871c1d261b160b6ea02030d.tar.gz
tests: simplify test_parse_special_fields by using float for timestamps
Diffstat (limited to 'tests/test_base.py')
-rw-r--r--tests/test_base.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_base.py b/tests/test_base.py
index 5d3b716..4184158 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -100,16 +100,16 @@ class TestBase(utils_tests.SetupDirectory):
"""TestBase: Task name, PID, CPU and timestamp are properly paresed """
events = {
- '1001.456789' : { 'task': 'rcu_preempt', 'pid': 1123, 'cpu': 001 },
- '1002.456789' : { 'task': 'rs:main', 'pid': 2123, 'cpu': 002 },
- '1003.456789' : { 'task': 'AsyncTask #1', 'pid': 3123, 'cpu': 003 },
- '1004.456789' : { 'task': 'kworker/1:1H', 'pid': 4123, 'cpu': 004 },
- '1005.456789' : { 'task': 'jbd2/sda2-8', 'pid': 5123, 'cpu': 005 },
+ 1001.456789 : { 'task': 'rcu_preempt', 'pid': 1123, 'cpu': 001 },
+ 1002.456789 : { 'task': 'rs:main', 'pid': 2123, 'cpu': 002 },
+ 1003.456789 : { 'task': 'AsyncTask #1', 'pid': 3123, 'cpu': 003 },
+ 1004.456789 : { 'task': 'kworker/1:1H', 'pid': 4123, 'cpu': 004 },
+ 1005.456789 : { 'task': 'jbd2/sda2-8', 'pid': 5123, 'cpu': 005 },
}
in_data = """"""
for timestamp in sorted(events):
- in_data+="{0:>16s}-{1:d} [{2:04d}] {3:s}: event0: tag=value\n".\
+ in_data+="{0:>16s}-{1:d} [{2:04d}] {3}: event0: tag=value\n".\
format(
events[timestamp]['task'],
events[timestamp]['pid'],
@@ -129,7 +129,6 @@ class TestBase(utils_tests.SetupDirectory):
self.assertEquals(set(dfr.columns), expected_columns)
for timestamp, event in events.iteritems():
- timestamp = float(timestamp)
self.assertEquals(dfr["__comm"].loc[timestamp], event['task'])
self.assertEquals(dfr["__pid"].loc[timestamp], event['pid'])
self.assertEquals(dfr["__cpu"].loc[timestamp], event['cpu'])