Started adding some skeleton tests.
--HG-- branch : mjc extra : transplant_source : .T%A9%E7%F3%0E%A620%F1G%C2%1E%C4%60%88%14%29%20%23
This commit is contained in:
27
lang/python/tests/PackTest.py
Normal file
27
lang/python/tests/PackTest.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (c) 2010 WiredTiger. All rights reserved.
|
||||
#
|
||||
# Python unit tests for the wiredtiger.*pack* methods.
|
||||
|
||||
from wiredtiger import pack, unpack
|
||||
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
|
||||
class TestPacking(unittest.TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def test_simple(self):
|
||||
for b in (0, 10, 65):
|
||||
self.assertEqual(pack('b', b), chr(b))
|
||||
for b in (0, 10, 65, 255):
|
||||
self.assertEqual(pack('B', b), chr(b))
|
||||
for b in (0, 10, 65, 255):
|
||||
self.assertEqual(pack('c', chr(b)), chr(b))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user