示例#1
0
 def test_serialise_to_json_file(self, crystal, tmpdir):
     # Serialise
     output_file = str(tmpdir.join('tmp.test'))
     crystal.to_json_file(output_file)
     # Test file metadata
     check_json_metadata(output_file, 'Crystal')
     # Deserialise
     deserialised_crystal = Crystal.from_json_file(output_file)
     return check_crystal(crystal, deserialised_crystal)
示例#2
0
def get_crystal_from_json_file(filepath):
    return Crystal.from_json_file(filepath)