Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Apr 15, 2016
1 parent b3e9cb6 commit eb2c32f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ def test_merge(self):
self.assertEqual(config["m"], {"i": 1, "j": [7, 8], "k": [5, "z", "v", "v", "z", "z"]})

def test_ingest(self):
with tempfile.NamedTemporaryFile() as cf1, tempfile.NamedTemporaryFile() as cf2:
with tempfile.NamedTemporaryFile("w") as cf1, tempfile.NamedTemporaryFile("w") as cf2:
json.dump(dict(x="foo", y="bar", z={}), cf1)
cf1.flush()
json.dump(dict(x=range(8), z={None: None}, t=4.5), cf2)
json.dump(dict(x=list(range(8)), z={None: None}, t=4.5), cf2)
cf2.flush()
os.environ["TWEAK_TEST_CONFIG_FILE"] = ":".join([cf1.name, cf2.name])
config = Config("TWEAK_TEST")
self.assertEqual(dict(config), {'y': 'bar', 'x': range(8), 'z': {'null': None}, 't': 4.5})
self.assertEqual(dict(config), {'y': 'bar', 'x': list(range(8)), 'z': {'null': None}, 't': 4.5})

if __name__ == '__main__':
unittest.main()

0 comments on commit eb2c32f

Please sign in to comment.