예제 #1
0
class TestContext(TestCase):
    """Run tests on the `Context` class."""
    def setUp(self):
        """Setup some default variables for test usage."""
        self.c = Context('context', 'extension', 'priority')

    def test_attrs_stick(self):
        """Ensure attributes stick."""
        self.assertEqual(self.c.context, 'context')
        self.assertEqual(self.c.extension, 'extension')
        self.assertEqual(self.c.priority, 'priority')

    def test_render_valid_context(self):
        """Ensure `render` works using a valid `context` attribute."""
        self.assertTrue('context' in ''.join(self.c.render()))

    def test_render_valid_extension(self):
        """Ensure `render` works using a valid `extension` attribute."""
        self.assertTrue('extension' in ''.join(self.c.render()))

    def test_render_valid_priority(self):
        """Ensure `render` works using a valid `priority` attribute."""
        self.assertTrue('priority' in ''.join(self.c.render()))
예제 #2
0
class TestContext(TestCase):
	"""Run tests on the `Context` class."""

	def setUp(self):
		"""Setup some default variables for test usage."""
		self.c = Context('context', 'extension', 'priority')

	def test_attrs_stick(self):
		"""Ensure attributes stick."""
		eq_(self.c.context, 'context')
		eq_(self.c.extension, 'extension')
		eq_(self.c.priority, 'priority')

	def test_render_valid_context(self):
		"""Ensure `render` works using a valid `context` attribute."""
		ok_('context' in ''.join(self.c.render()))

	def test_render_valid_extension(self):
		"""Ensure `render` works using a valid `extension` attribute."""
		ok_('extension' in ''.join(self.c.render()))

	def test_render_valid_priority(self):
		"""Ensure `render` works using a valid `priority` attribute."""
		ok_('priority' in ''.join(self.c.render()))
예제 #3
0
	def setUp(self):
		"""Setup some default variables for test usage."""
		self.c = Context('context', 'extension', 'priority')
예제 #4
0
 def setUp(self):
     """Setup some default variables for test usage."""
     self.c = Context('context', 'extension', 'priority')