Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 531 json load #533

Merged
merged 2 commits into from
Apr 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
testing ids are correctly read in
  • Loading branch information
doutriaux1 committed Mar 30, 2018
commit 9ca97929b15266e76ae78ea4f90d810ba570b13b
10 changes: 7 additions & 3 deletions tests/test_pmp_jsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import inspect
import os
import numpy

import json

class TestJSONs(unittest.TestCase):
def testVariability(self):
Expand Down Expand Up @@ -44,6 +44,10 @@ def testVariability(self):
assert(numpy.allclose(data, 0.7626659864144966))
def testCustomStruct(self):
pth = os.path.dirname(inspect.getfile(self.__class__))
J = pcmdi_metrics.io.base.JSONs([os.path.join(pth,"io","test_MC1_alljson")])
print J.getAxisList()
json_pth = os.path.join(pth,"io","test_MC1_all.json")
J = pcmdi_metrics.io.base.JSONs([json_pth])
jids = J.getAxisIds()[1:]
json_data = json.load(open(json_pth))
json_struct = json_data[u'json_structure']
self.assertTrue(jids == json_struct)