-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathrun_simple_test.py
90 lines (74 loc) · 2.19 KB
/
run_simple_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python
'''Aim: just make sure pytraj runnable.
'''
import unittest
from pytraj import *
import pytraj as pt
from utils import fn
from pytraj.analysis.c_action.c_action import ActionDict
from pytraj.trajectory.c_traj import *
from pytraj.datasets import *
from pytraj.all_actions import *
from pytraj.core import c_dict
from pytraj.utils.misc import get_atts
class TestRunnable(unittest.TestCase):
def test_loading(self):
traj = pt.load_sample_data('tz2')
traj[:]
traj[:3]
# load from a list of files
fname = traj.filename
t0 = pt.iterload(
[fname, fname], traj.top, frame_slice=[
(0, 8, 2),
] * 2)
def test_import(self):
from pytraj import run_tests
run_tests()
def test_create_actions(self):
print("try to make all action objects")
failed_list = []
adict = ActionDict()
for key in adict.keys():
if key not in failed_list:
pass
def test_create_(self):
DatasetList()
print("try to make all analysis objects")
from pytraj import analdict
failed_list = []
for key in analdict.keys():
if key not in failed_list:
analdict[key]
def test_Dataset(self):
print("try to make all dataset stuff")
DatasetDouble()
DatasetFloat()
DatasetInteger()
DatasetString()
DatasetMatrixDouble()
DatasetMatrixFloat()
DatasetVector()
DatasetCoords()
DatasetCoordsRef()
DatasetCoordsCRD()
def test_geometry(self):
print("try to make structure-related objects")
Topology()
Molecule()
Residue()
Atom()
Frame()
TrajectoryIterator()
def test_other(self):
print("other stuff. throw all tests don't belong anywhere else here")
keys = get_atts(c_dict)
cdict = c_dict.__dict__
for key in keys:
if isinstance(cdict[key], dict):
assert cdict[key].keys() is not None
if __name__ == "__main__":
from pytraj import show_versions
show_versions()
print('')
unittest.main()