[Piglit] [PATCH 10/20] dmesg_tests.py: refactor a few tests
Dylan Baker
baker.dylan.c at gmail.com
Sat Jun 14 08:05:19 PDT 2014
This drops some unused variable assignments, and refactors a test that
uses a test for providing data.
---
framework/tests/dmesg_tests.py | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/framework/tests/dmesg_tests.py b/framework/tests/dmesg_tests.py
index 4e6ce7d..44723a7 100644
--- a/framework/tests/dmesg_tests.py
+++ b/framework/tests/dmesg_tests.py
@@ -63,14 +63,12 @@ def _write_dev_kmesg():
def test_linux_initialization():
""" Test that LinuxDmesg initializes """
- dmesg = LinuxDmesg()
- assert dmesg
+ LinuxDmesg()
def test_dummy_initialization():
""" Test that DummyDmesg initializes """
- dmesg = DummyDmesg()
- assert dmesg
+ DummyDmesg()
def test_get_dmesg_dummy():
@@ -254,14 +252,20 @@ def test_update_result_add_dmesg():
nt.assert_in('dmesg', result,
msg="result does not have dmesg member but should")
- return result
def test_json_serialize_updated_result():
""" Test that a TestResult that has been updated is json serializable """
+ dmesg = _get_dmesg()
+
+ result = TestResult()
+ result['result'] = 'pass'
+
+ _write_dev_kmesg()
+ result = dmesg.update_result(result)
+
encoder = PiglitJSONEncoder()
- result = test_update_result_add_dmesg()
- encoded = encoder.encode(result)
+ encoder.encode(result)
@utils.nose_generator
--
2.0.0
More information about the Piglit
mailing list