File: errors.py

package info (click to toggle)
pmock 0.3-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 932 kB
  • ctags: 816
  • sloc: python: 1,674; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 497 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Show some test errors generated by pmock"""

from pmock import *
import unittest


class ErrorsTest(unittest.TestCase):

    def test_unsatisfied_expectation(self):
        mock = Mock()
        mock.expects(once()).foo()
        mock.verify()

    def test_unexpected_call(self):
        mock = Mock()
        mock.foo()

    def test_conflicting_call(self):
        mock = Mock()
        mock.expects(never()).foo()
        mock.foo()


if __name__ == '__main__':
    unittest.main()