示例#1
0
class TestBaseExport(TestCase):
    def setUp(self):  # noqa
        self.fake_template_env = MagicMock()
        self.export = BaseExport(template_env=self.fake_template_env)

    def test_get_template(self):
        self.export.get_template('foo/bar.tpl')
        self.fake_template_env.get_template.assert_called_with('foo/bar.tpl')
示例#2
0
 def test_get_template(self):
     fake_env = Mock()
     export = BaseExport(template_env=fake_env)
     export.get_template('foo/bar.tpl')
     fake_env.get_template.assert_called_with('foo/bar.tpl')
示例#3
0
 def test_get_template(self):
     fake_env = Mock()
     export = BaseExport(template_env=fake_env)
     export.get_template('foo/bar.tpl')
     fake_env.get_template.assert_called_with('foo/bar.tpl')
示例#4
0
 def test_env_template_dir(self, loader_mock, env_mock):
     BaseExport(template_dir='foo/bar')
     loader_mock.assert_called_with(['foo/bar'])
     env_mock.assert_called_with(loader=loader_mock.return_value)
示例#5
0
 def setUp(self):  # noqa
     self.fake_template_env = MagicMock()
     self.export = BaseExport(template_env=self.fake_template_env)