Skip to content

Commit 2dee575

Browse files
committed
TST: cover _hashSymOpList utility
1 parent 5f8650c commit 2dee575

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python
2+
##############################################################################
3+
#
4+
# diffpy.structure Complex Modeling Initiative
5+
# (c) 2019 Brookhaven Science Associates,
6+
# Brookhaven National Laboratory.
7+
# All rights reserved.
8+
#
9+
# File coded by: Pavol Juhas
10+
#
11+
# See AUTHORS.txt for a list of people who contributed.
12+
# See LICENSE.txt for license information.
13+
#
14+
##############################################################################
15+
16+
"""Unit tests for diffpy.structure.spacegroups
17+
"""
18+
19+
20+
import unittest
21+
22+
from diffpy.structure.spacegroups import SpaceGroupList, _hashSymOpList
23+
24+
# ----------------------------------------------------------------------------
25+
26+
class TestRoutines(unittest.TestCase):
27+
28+
def setUp(self):
29+
return
30+
31+
32+
def test__hashSymOpList(self):
33+
"verify _hashSymOpList is unique for each spacegroup"
34+
hset = set(_hashSymOpList(sg.symop_list) for sg in SpaceGroupList)
35+
self.assertEqual(len(SpaceGroupList), len(hset))
36+
return
37+
38+
# End of class TestRoutines
39+
40+
# ----------------------------------------------------------------------------
41+
42+
if __name__ == '__main__':
43+
unittest.main()

0 commit comments

Comments
 (0)