-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aceadb3
commit 2242536
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |