コード例 #1
0
ファイル: test_fudge.py プロジェクト: buddylindsey/fudge
    def test_not_enough_calls(self):
        # need to drop down a level to bypass expected calls:
        r = Registry()
        fake = Fake()
        call_order = ExpectedCallOrder(fake)
        r.remember_expected_call_order(call_order)

        exp = ExpectedCall(fake, "callMe", call_order=call_order)
        call_order.add_expected_call(exp)

        r.verify()
コード例 #2
0
ファイル: test_fudge.py プロジェクト: jayvdb/fudge-1
    def test_not_enough_calls(self):
        # need to drop down a level to bypass expected calls:
        r = Registry()
        fake = Fake()
        call_order = ExpectedCallOrder(fake)
        r.remember_expected_call_order(call_order)

        exp = ExpectedCall(fake, "callMe", call_order=call_order)
        call_order.add_expected_call(exp)

        r.verify()
コード例 #3
0
ファイル: test_fudge.py プロジェクト: buddylindsey/fudge
    def test_only_one_call(self):
        # need to drop down a level to bypass expected calls:
        r = Registry()
        fake = Fake()
        call_order = ExpectedCallOrder(fake)
        r.remember_expected_call_order(call_order)

        exp = ExpectedCall(fake, "one", call_order=call_order)
        call_order.add_expected_call(exp)
        exp() # call this

        exp = ExpectedCall(fake, "two", call_order=call_order)
        call_order.add_expected_call(exp)

        r.verify()
コード例 #4
0
ファイル: test_fudge.py プロジェクト: jayvdb/fudge-1
    def test_only_one_call(self):
        # need to drop down a level to bypass expected calls:
        r = Registry()
        fake = Fake()
        call_order = ExpectedCallOrder(fake)
        r.remember_expected_call_order(call_order)

        exp = ExpectedCall(fake, "one", call_order=call_order)
        call_order.add_expected_call(exp)
        exp()  # call this

        exp = ExpectedCall(fake, "two", call_order=call_order)
        call_order.add_expected_call(exp)

        r.verify()