def test_saveload_json(self):
     filename = "tmp_json_file"
     obj_init =[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
     tools.savejson(filename, obj_init)
     obj_read = tools.loadjson(filename)
     self.assertEqual(obj_read, obj_init)
     os.remove(filename)
 def test_saveload_json(self):
     filename = "tmp_json_file"
     obj_init =[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
     tools.savejson(filename, obj_init)
     obj_read = tools.loadjson(filename)
     self.assertEqual(obj_read, obj_init)
     os.remove(filename)
Beispiel #3
0
def load(path):
    """ Imports session from disk
    """
    for name in ['parameters', 'paths']:
        fullfile = join(_full(path), 'seisflows_' + name + '.json')
        sys.modules['seisflows_' + name] = Dict(loadjson(fullfile))

    for name in names:
        fullfile = join(_full(path), 'seisflows_' + name + '.p')
        sys.modules['seisflows_' + name] = loadobj(fullfile)
def load(path):
    """ Imports session from disk
    """
    for name in ['parameters', 'paths']:
        fullfile = join(_full(path), 'seisflows_'+name+'.json')
        sys.modules['seisflows_'+name] = Dict(loadjson(fullfile))

    for name in names:
        fullfile = join(_full(path), 'seisflows_'+name+'.p')
        sys.modules['seisflows_'+name] = loadobj(fullfile)