Skip to content

Commit

Permalink
Add extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yafshar committed Mar 13, 2024
1 parent abebcd3 commit 696eb29
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_kim_edn/test_dump.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from io import StringIO
import os
from tests.test_kim_edn import PyTest


Expand All @@ -9,6 +10,14 @@ def test_dump(self):
self.kim_edn.dump({}, sio)
self.assertEqual(sio.getvalue(), '{}\n') # NOTE

d = {1337: "true.ed"}
self.addCleanup(os.remove, d[1337])

self.kim_edn.dump(d, d[1337])

self.assertEqual(self.kim_edn.load('{"1337" "true.ed"}'),
self.kim_edn.load(d[1337]))

def test_dumps(self):
self.assertEqual(self.dumps({}), '{}')

Expand Down Expand Up @@ -36,10 +45,10 @@ def __lt__(self, o):

L = [X() for i in range(1122)]
d = D()
d[hash(d.keys()[0])] = "true.dat"
d[hash(d.keys()[0])] = "true.edn"

self.assertEqual(self.dumps(d, sort_keys=(not L[0] < L[1])),
'{"1337" "true.dat"}')
'{"1337" "true.edn"}')


class TestPyDump(TestDump, PyTest):
Expand Down

0 comments on commit 696eb29

Please sign in to comment.