Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_force_constant.py
blobf1a760415fd68ce4205c322712b6a39f4cef62be
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # tests force.constant
9 class force_constant_tests (unittest.TestCase):
10 def setUp(self):
11 print
12 init.create_random(N=100, phi_p=0.05);
14 sorter.set_params(grid=8)
16 # test to see that se can create a force.constant
17 def test_create(self):
18 force.constant(fx=1.0, fy=0.5, fz=0.74);
20 # test changing the force
21 def test_change_force(self):
22 const = force.constant(fx=1.0, fy=0.5, fz=0.74);
23 const.set_force(fx=1.45, fy=0.25, fz=-0.1);
25 # test the initialization checks
26 def test_init_checks(self):
27 const = force.constant(fx=1.0, fy=0.5, fz=0.74);
28 const.cpp_force = None;
30 self.assertRaises(RuntimeError, const.set_force, fx=1.45, fy=0.25, fz=-0.1);
31 self.assertRaises(RuntimeError, const.enable);
32 self.assertRaises(RuntimeError, const.disable);
33 self.assertRaises(RuntimeError, const.benchmark, 500);
35 def tearDown(self):
36 init.reset();
39 if __name__ == '__main__':
40 unittest.main(argv = ['test.py', '-v'])