def test_json_serialize_updated_result(): """ Test that a TestResult that has been updated is json serializable """ test = TestDmesg() result = framework.results.TestResult() result['result'] = 'pass' test._new_messages = ['some', 'new', 'messages'] result = test.update_result(result) encoder = json.JSONEncoder(default=framework.backends.piglit_encoder) encoder.encode(result)
def test_update_result_add_dmesg(): """dmesg.Dmesg.update_result: sets the dmesg attribute""" test = TestDmesg() result = framework.results.TestResult() result.result = "pass" messages = ["some", "new", "messages"] test._new_messages = messages result = test.update_result(result) nt.eq_(result.dmesg, "\n".join(messages), msg="result does not have dmesg member but should")
def test_json_serialize_updated_result(): """ Test that a TestResult that has been updated is json serializable """ test = TestDmesg() result = framework.results.TestResult() result['result'] = 'pass' test._new_messages = ['some', 'new', 'messages'] result = test.update_result(result) encoder = json.JSONEncoder(default=framework.backends.json.piglit_encoder) encoder.encode(result)
def test_update_result_add_dmesg(): """ Tests update_result's addition of dmesg attribute """ test = TestDmesg() result = framework.results.TestResult() result['result'] = 'pass' test._new_messages = ['some', 'new', 'messages'] result = test.update_result(result) nt.assert_in('dmesg', result, msg="result does not have dmesg member but should")
def test_json_serialize_updated_result(): """dmesg.Dmesg.update_result: The TestResult is still json serializable""" test = TestDmesg() result = framework.results.TestResult() result.result = 'pass' test._new_messages = ['some', 'new', 'messages'] result = test.update_result(result) encoder = json.JSONEncoder(default=framework.backends.json.piglit_encoder) encoder.encode(result)
def test_update_result_add_dmesg(): """dmesg.Dmesg.update_result: sets the dmesg attribute""" test = TestDmesg() result = framework.results.TestResult() result.result = 'pass' messages = ['some', 'new', 'messages'] test._new_messages = messages result = test.update_result(result) nt.eq_(result.dmesg, '\n'.join(messages), msg="result does not have dmesg member but should")