Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_option.py
blob70bab3df011b2f3043bd91288fd4329b1f62de70
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 that mode settings work properly
14 def test_mode(self):
15 option.set_mode('gpu');
16 self.assert_(globals.options.mode == 'gpu');
18 option.set_mode('cpu');
19 self.assert_(globals.options.mode == 'cpu');
21 option.set_mode(None);
22 self.assert_(globals.options.mode is None);
24 self.assertRaises(RuntimeError, option.set_mode, 'foo');
26 def test_gpu(self):
27 option.set_gpu(1);
28 self.assert_(globals.options.gpu == 1);
29 self.assert_(globals.options.mode == 'gpu');
31 option.set_gpu(None);
32 self.assert_(globals.options.gpu is None);
34 self.assertRaises(RuntimeError, option.set_gpu, 'foo');
36 def test_gpu_error_checking(self):
37 option.set_gpu_error_checking(False);
38 self.assert_(globals.options.gpu_error_checking == False);
40 option.set_gpu_error_checking(True);
41 self.assert_(globals.options.gpu_error_checking == True);
43 def test_min_cpu(self):
44 option.set_min_cpu(False);
45 self.assert_(globals.options.min_cpu == False);
47 option.set_min_cpu(True);
48 self.assert_(globals.options.min_cpu == True);
50 def test_ignore_display(self):
51 option.set_ignore_display(False);
52 self.assert_(globals.options.ignore_display == False);
54 option.set_ignore_display(True);
55 self.assert_(globals.options.ignore_display == True);
57 def test_notice_level(self):
58 option.set_notice_level(1);
59 self.assert_(globals.options.notice_level == 1);
61 option.set_notice_level(10);
62 self.assert_(globals.options.notice_level == 10);
64 self.assertRaises(RuntimeError, option.set_notice_level, 'foo');
66 def tearDown(self):
67 pass;
70 if __name__ == '__main__':
71 unittest.main(argv = ['test.py', '-v'])