示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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))
示例#4
0
    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))