We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6191146 commit b6d9961Copy full SHA for b6d9961
src/diffpy/structure/tests/teststructure.py
@@ -18,6 +18,7 @@
18
19
20
import copy
21
+import pickle
22
import unittest
23
import numpy
24
@@ -656,6 +657,17 @@ def test_Bij(self):
656
657
self.assertFalse(numpy.any(stru.U != 0.0))
658
return
659
660
+
661
+ def test_pickling(self):
662
+ """Make sure Atom in Structure can be consistently pickled.
663
+ """
664
+ stru = self.stru
665
+ a = stru[0]
666
+ self.assertTrue(a is stru[0])
667
+ a1, stru1 = pickle.loads(pickle.dumps((a, stru)))
668
+ self.assertTrue(a1 is stru1[0])
669
+ return
670
671
# End of class TestStructure
672
673
# ----------------------------------------------------------------------------
0 commit comments