mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-10 09:35:56 +00:00
0892db6fa7
git-subtree-dir: SpiffWorkflow git-subtree-split: 63db3e45947ec66b8d0efc2c74064004f8ff482c
27 lines
778 B
Python
27 lines
778 B
Python
import unittest
|
|
|
|
from SpiffWorkflow.bpmn.PythonScriptEngine import Box
|
|
|
|
|
|
class BoxDeepCopyTest(unittest.TestCase):
|
|
|
|
def test_deep_copy_of_box(self):
|
|
data = {"foods": {
|
|
"spam": {"delicious": False}
|
|
},
|
|
"hamsters": ['your', 'mother']
|
|
}
|
|
data = Box(data)
|
|
data2 = data.__deepcopy__()
|
|
self.assertEqual(data, data2)
|
|
data.foods.spam.delicious = True
|
|
data.hamsters = ['your', 'father']
|
|
self.assertFalse(data2.foods.spam.delicious)
|
|
self.assertEqual(['your', 'mother'], data2.hamsters)
|
|
|
|
def suite():
|
|
return unittest.TestLoader().loadTestsFromTestCase(BoxDeepCopyTest)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.TextTestRunner(verbosity=2).run(suite())
|