1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
8 # unit tests for dump.xml
9 class dmp_xml_tests (unittest
.TestCase
):
12 init
.create_random(N
=100, phi_p
=0.05);
14 sorter
.set_params(grid
=8)
16 # tests basic creation of the dump
18 dump
.xml(filename
="dump_xml", period
=100);
20 # test variable period
21 def test_variable(self
):
22 dump
.xml(filename
="dump_xml", period
=lambda n
: n
*100);
25 def test_set_params(self
):
26 xml
= dump
.xml(filename
="dump_xml", period
=100);
27 xml
.set_params(position
=True);
28 xml
.set_params(velocity
=True);
29 xml
.set_params(mass
=False);
30 xml
.set_params(diameter
=False);
31 xml
.set_params(type=True);
32 xml
.set_params(wall
=True);
33 xml
.set_params(bond
=True);
34 xml
.set_params(image
=True);
35 xml
.set_params(all
=True);
40 if __name__
== '__main__':
41 unittest
.main(argv
= ['test.py', '-v'])