summaryrefslogtreecommitdiff
path: root/pystache/tests/test___init__.py
blob: d4f35260e19d170b220f94ca0ab2c78c3d350046 (plain)
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
30
31
32
33
34
35
36
# coding: utf-8

"""
Tests of __init__.py.

"""

# Calling "import *" is allowed only at the module level.
GLOBALS_INITIAL = globals().keys()
from pystache import *
GLOBALS_PYSTACHE_IMPORTED = globals().keys()

import unittest

import pystache


class InitTests(unittest.TestCase):

    def test___all__(self):
        """
        Test that "from pystache import *" works as expected.

        """
        actual = set(GLOBALS_PYSTACHE_IMPORTED) - set(GLOBALS_INITIAL)
        expected = set(['render', 'Renderer', 'TemplateSpec', 'GLOBALS_INITIAL'])

        self.assertEqual(actual, expected)

    def test_version_defined(self):
        """
        Test that pystache.__version__ is set.

        """
        actual_version = pystache.__version__
        self.assertTrue(actual_version)