Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_update_rescale_temp.py
blobb4aedc2e03f49e3eaf818952b6871948b3bf006b
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # tests for update.rescale_temp
9 class update_rescale_temp_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 # tests basic creation of the updater
17 def test(self):
18 update.rescale_temp(T=1.0)
19 run(100);
21 # test variable periods
22 def test_variable(self):
23 update.rescale_temp(T=1.0, period=lambda n: n*10)
24 run(100);
26 # test enable/disable
27 def test_enable_disable(self):
28 upd = update.rescale_temp(T=1.0)
29 upd.disable();
30 self.assert_(not upd.enabled);
31 upd.disable();
32 self.assert_(not upd.enabled);
33 upd.enable();
34 self.assert_(upd.enabled);
35 upd.enable();
36 self.assert_(upd.enabled);
38 # test set_period
39 def test_set_period(self):
40 upd = update.rescale_temp(T=1.0)
41 upd.set_period(10);
42 upd.disable();
43 self.assertEqual(10, upd.prev_period);
44 upd.set_period(50);
45 self.assertEqual(50, upd.prev_period);
46 upd.enable();
48 # test set_params
49 def test_set_params(self):
50 upd = update.rescale_temp(T=1.0);
51 upd.set_params(T=1.2);
53 def tearDown(self):
54 init.reset();
57 if __name__ == '__main__':
58 unittest.main(argv = ['test.py', '-v'])