Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_pair_nlist.py
blob633d752367776e8e114b129b4c3cda5ce24b6eb7
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # pair.nlist testing
9 class pair_nlist_tests (unittest.TestCase):
10 def setUp(self):
11 print
12 init.create_random(N=100, phi_p=0.05);
13 #indirectly create the neighbor list by creating a pair.lj
14 pair.lj(r_cut=3.0);
16 sorter.set_params(grid=8)
19 # test set_params
20 def test_set_params(self):
21 globals.neighbor_list.set_params(r_buff=0.6);
22 globals.neighbor_list.set_params(check_period = 20);
24 # test reset_exclusions
25 def test_reset_exclusions_works(self):
26 globals.neighbor_list.reset_exclusions();
27 globals.neighbor_list.reset_exclusions(exclusions = ['1-2']);
28 globals.neighbor_list.reset_exclusions(exclusions = ['1-3']);
29 globals.neighbor_list.reset_exclusions(exclusions = ['1-4']);
30 globals.neighbor_list.reset_exclusions(exclusions = ['bond']);
31 globals.neighbor_list.reset_exclusions(exclusions = ['angle']);
32 globals.neighbor_list.reset_exclusions(exclusions = ['dihedral']);
33 globals.neighbor_list.reset_exclusions(exclusions = ['bond', 'angle']);
35 # test reset_exclusions error messages
36 def test_reset_exclusions_nowork(self):
37 self.assertRaises(RuntimeError,
38 globals.neighbor_list.reset_exclusions,
39 exclusions = ['bond', 'angle', 'invalid']);
41 def tearDown(self):
42 init.reset();
44 if __name__ == '__main__':
45 unittest.main(argv = ['test.py', '-v'])