Test copy.deepcopy() against parsed document. Previous versions of python-stix would cause an exception with copy.deepcopy() when applied to a parsed STIX component which contained timestamp information. This was due to the lack of a __reduce__ function defined on t
(self)
| 116 | |
| 117 | @silence_warnings |
| 118 | def test_deepcopy(self): |
| 119 | """Test copy.deepcopy() against parsed document. |
| 120 | |
| 121 | Previous versions of python-stix would cause an exception with |
| 122 | copy.deepcopy() when applied to a parsed STIX component which contained |
| 123 | timestamp information. |
| 124 | |
| 125 | This was due to the lack of a __reduce__ function defined on the |
| 126 | bindings._FixedTZOffset class. |
| 127 | |
| 128 | """ |
| 129 | package = core.STIXPackage.from_xml( |
| 130 | BytesIO( |
| 131 | core.STIXPackage().to_xml() |
| 132 | ) |
| 133 | ) |
| 134 | |
| 135 | copied = copy.deepcopy(package) |
| 136 | self.assertEqual(package.timestamp, copied.timestamp) |
| 137 | |
| 138 | @assert_warnings |
| 139 | def test_deprecated_idref(self): |