示例#1
0
 def test_import_incomplete_path(self, mock_exit):
     cli._import('foo')
     error_msg = '[error] please supply full path to your custom renderer.'
     mock_exit.assert_called_with(error_msg)
示例#2
0
 def test_import_class_error(self, mock_exit, mock_import_module):
     cli._import('foo.Renderer')
     error_msg = '[error] cannot find renderer "Renderer" from module "foo".'
     mock_exit.assert_called_with(error_msg)
示例#3
0
 def test_import_success(self, mock_import_module):
     self.assertEqual(sentinel.RendererCls, cli._import('foo.Renderer'))
示例#4
0
 def test_import_module_error(self, mock_exit, mock_import_module):
     cli._import('foo.Renderer')
     mock_exit.assert_called_with('[error] cannot import module "foo".')