Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
infothrill committed Oct 24, 2013
1 parent aceadb3 commit 2242536
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/constant_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-

import unittest

from bitsnoop.constant_type import ConstantType, Constants


class ConstantTypeTest(unittest.TestCase):

def setUp(self):
unittest.TestCase.setUp(self)

def tearDown(self):
unittest.TestCase.tearDown(self)

def test_Constants(self):
self.assertEqual(type(ConstantType), type)
self.assertEqual(type(Constants), ConstantType)

class FOO(Constants):
BAR = 1

self.assertTrue(repr(Constants).startswith("ConstantType"))
self.assertTrue(repr(FOO).startswith("ConstantType"))
self.assertEqual(ConstantType, type(FOO))
self.assertEqual(1, FOO.BAR)
self.assertEqual(str, type(str(FOO)))
self.assertEqual("1", str(FOO.BAR))

0 comments on commit 2242536

Please sign in to comment.