Fix potential problem in Messenger related to MPI window
[hoomd-blue.git] / test / hoomd_script / test_init_create_random.py
blob54eb1dede908867e5322cd229275e0e39663854e
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # unit tests for init.create_random
9 class init_create_random_tests (unittest.TestCase):
10 def setUp(self):
11 print
13 # tests basic creation of the random initializer
14 def test(self):
15 init.create_random(N=100, phi_p=0.05);
16 self.assert_(globals.system_definition);
17 self.assert_(globals.system);
19 # tests creation with a few more arguments specified
20 def test_moreargs(self):
21 init.create_random(name="B", min_dist=0.1, N=100, phi_p=0.05);
22 self.assert_(globals.system_definition);
23 self.assert_(globals.system);
25 # tests creation with a specified box
26 def test_box(self):
27 init.create_random(name="B", min_dist=0.1, N=100, box=data.boxdim(L=100));
28 self.assert_(globals.system_definition);
29 self.assert_(globals.system);
31 # checks for an error if initialized twice
32 def test_inittwice(self):
33 init.create_random(N=100, phi_p=0.05);
34 self.assertRaises(RuntimeError, init.create_random, N=100, phi_p=0.05);
36 def tearDown(self):
37 init.reset();
40 if __name__ == '__main__':
41 unittest.main(argv = ['test.py', '-v'])