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')
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')
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)
def setUp(self): # noqa self.fake_template_env = MagicMock() self.export = BaseExport(template_env=self.fake_template_env)