Fix potential problem in Messenger related to MPI window
[hoomd-blue.git] / test / hoomd_script / test_analyze_msd.py
blob9f089c6e7c96af0e326e60401d985be24667e633
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # unit tests for analyze.msd
9 class analyze_msd_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 analyzer
17 def test(self):
18 analyze.msd(period = 10, filename="test.log", groups=[group.all()]);
19 run(100);
21 # test variable period
22 def test_variable(self):
23 analyze.msd(period = lambda n: n*10, filename="test.log", groups=[group.all()]);
24 run(100);
26 # test error if no groups defined
27 def test_no_gropus(self):
28 self.assertRaises(RuntimeError, analyze.msd, period=10, filename="test.log", groups=[]);
30 # test set_params
31 def test_set_params(self):
32 ana = analyze.msd(period = 10, filename="test.log", groups=[group.all()]);
33 ana.set_params(delimiter = ' ');
34 run(100);
36 def tearDown(self):
37 init.reset();
38 if comm.get_rank() == 0:
39 os.remove("test.log");
41 if __name__ == '__main__':
42 unittest.main(argv = ['test.py', '-v'])