test_example.py 357 B

123456789101112131415161718
  1. try:
  2. import unittest2 as unittest
  3. except ImportError:
  4. import unittest
  5. try:
  6. from unittest import mock
  7. except ImportError:
  8. import mock
  9. from qrcode import run_example
  10. class ExampleTest(unittest.TestCase):
  11. @mock.patch('PIL.Image.Image.show')
  12. def runTest(self, mock_show):
  13. run_example()
  14. mock_show.assert_called_with()