예제 #1
0
def test_local():
    db = ChemlabDB()
    bz = db.get("molecule", "example.norbornene")

    pre_string = bz.tojson()
    db = LocalDB("/tmp/testdb/")
    db.store("molecule", 'norbornene', bz, nowarn=True)
    
    post_string = db.get('molecule', 'norbornene').tojson()
    assert pre_string == post_string
    
    # Do the same thing for a system of 3 norbornenes
    s = System([bz.copy() for i in range(3)])
    pre_string = s.tojson()
    db.store("system", 'norbornene-3', s, nowarn=True)
    post_string = db.get('system', 'norbornene-3').tojson()
    
    assert pre_string == post_string
예제 #2
0
파일: test_db.py 프로젝트: yccai/chemlab
def test_local():
    db = ChemlabDB()
    bz = db.get("molecule", "example.norbornene")
    pre_dict = bz.to_dict()

    db = LocalDB("/tmp/testdb/")
    db.store("molecule", 'norbornene', bz, nowarn=True)

    post_dict = db.get('molecule', 'norbornene').to_dict()

    npeq_(pre_dict['r_array'], post_dict['r_array'])

    # Do the same thing for a system of 3 norbornenes
    s = System([bz.copy() for i in range(3)])
    pre_dict = s.to_dict()
    db.store("system", 'norbornene-3', s, nowarn=True)
    post_dict = db.get('system', 'norbornene-3').to_dict()

    npeq_(pre_dict['r_array'], post_dict['r_array'])
예제 #3
0
def test_local():
    db = ChemlabDB()
    bz = db.get("molecule", "example.norbornene")
    pre_dict = bz.to_dict()

    db = LocalDB("/tmp/testdb/")
    db.store("molecule", 'norbornene', bz, nowarn=True)
    
    post_dict = db.get('molecule', 'norbornene').to_dict()
    
    npeq_(pre_dict['r_array'], post_dict['r_array'])
    
    # Do the same thing for a system of 3 norbornenes
    s = System([bz.copy() for i in range(3)])
    pre_dict = s.to_dict()
    db.store("system", 'norbornene-3', s, nowarn=True)
    post_dict = db.get('system', 'norbornene-3').to_dict()
    
    npeq_(pre_dict['r_array'], post_dict['r_array'])