diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2013-09-18 05:07:46 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2013-09-18 05:07:46 +0000 |
commit | 4797eafddb99fd85d98944c6ccce04ea391951a3 (patch) | |
tree | bb3e38489329a99f43c10ea4aa29aa80e313d0fc /tools/dftestlib/time_relative.py | |
parent | ab7d8cc87dbac5cfdd23d93b7b336fb60ac790b3 (diff) |
Update dfilter-test.py to use a much more modern test harness,
the "unittest" module that comes with Python. Specifically, this
takes advantage of a couple of features in the "unittest" in
Python 2.7. The tests are all the same as before, but much
better managed.
This is in preparation for some work on the display filter code.
svn path=/trunk/; revision=52136
Diffstat (limited to 'tools/dftestlib/time_relative.py')
-rw-r--r-- | tools/dftestlib/time_relative.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/dftestlib/time_relative.py b/tools/dftestlib/time_relative.py new file mode 100644 index 0000000000..68abae511d --- /dev/null +++ b/tools/dftestlib/time_relative.py @@ -0,0 +1,19 @@ +# Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu> + +from dftestlib import dftest + +class testTimeRelative(dftest.DFTest): + trace_file = "nfs.cap" + + def test_relative_time_1(self): + dfilter = "frame.time_delta == 0.7" + self.assertDFilterCount(dfilter, 1) + + def test_relative_time_2(self): + dfilter = "frame.time_delta > 0.7" + self.assertDFilterCount(dfilter, 0) + + def test_relative_time_3(self): + dfilter = "frame.time_delta < 0.7" + self.assertDFilterCount(dfilter, 1) + |