Esempio n. 1
0
    def test_storing_1 (self):
        test = NotifyTestObject ()

        variable       = Variable ()
        variable.value = 100

        with variable.storing (test.simple_handler):
            variable.value = 200

        variable.value = 300

        test.assert_results (100, 200)
Esempio n. 2
0
    def test_storing_1(self):
        test = NotifyTestObject()

        variable = Variable()
        variable.value = 100

        with variable.storing(test.simple_handler):
            variable.value = 200

        variable.value = 300

        test.assert_results(100, 200)
Esempio n. 3
0
    def test_storing_2 (self):
        test = NotifyTestObject ()

        variable       = Variable ()
        variable.value = 100

        with nested (ignoring_exceptions (), variable.storing (test.simple_handler)):
            variable.value = 200
            raise Exception

        variable.value = 300

        test.assert_results (100, 200)
Esempio n. 4
0
    def test_storing_2(self):
        test = NotifyTestObject()

        variable = Variable()
        variable.value = 100

        with nested(ignoring_exceptions(),
                    variable.storing(test.simple_handler)):
            variable.value = 200
            raise Exception

        variable.value = 300

        test.assert_results(100, 200)