def test_replace_checks_fields(self): """ Replace will not work if the keyword is incorrect. """ result = Result(None, None, None, None, None) with self.assertRaises(ValueError): result._replace(not_a_field=1)
def test_can_replace(self): """ Can replace values. """ result1 = Result(None, None, None, None, None) result2 = result1._replace(expectation=1, actual=1) self.assertEqual( 'Result(expectation=1, actual=1, plugin=None, ' 'stdin=None, stdout=None)', repr(result2))