Skip to content

Commit a411238

Browse files
committed
Started on the test suite
1 parent eac4eb1 commit a411238

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

tests/__init__.py

Whitespace-only changes.

tests/fixtures/dump.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"lvar":{"type":"list","value":["lvalue","lvalue1"]},"svar":{"type":"set","value":["svalue"]},"akey":{"type":"string","value":"avalue"},"hvar":{"type":"hash","value":{"hkey":"hvalue"}}}

tests/redisdl_test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import redisdl
2+
import unittest
3+
import json
4+
import os.path
5+
6+
class RedisdlTest(unittest.TestCase):
7+
def test_roundtrip(self):
8+
path = os.path.join(os.path.dirname(__file__), 'fixtures', 'dump.json')
9+
with open(path) as f:
10+
dump = f.read()
11+
12+
redisdl.loads(dump)
13+
14+
redump = redisdl.dumps()
15+
16+
expected = json.loads(dump)
17+
actual = json.loads(redump)
18+
19+
self.assertEqual(expected, actual)

0 commit comments

Comments
 (0)