mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
parent
8bc691f580
commit
b564cd6725
2 changed files with 14 additions and 0 deletions
|
|
@ -35,6 +35,10 @@ impl ObjectIdentifier {
|
|||
.getattr(crate::intern!(py, "_OID_NAMES"))?;
|
||||
oid_names.call_method1("get", (slf, "Unknown OID"))
|
||||
}
|
||||
|
||||
fn __deepcopy__(slf: pyo3::PyRef<'_, Self>, _memo: pyo3::PyObject) -> pyo3::PyRef<'_, Self> {
|
||||
slf
|
||||
}
|
||||
}
|
||||
|
||||
#[pyo3::prelude::pyproto]
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
import copy
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -12,6 +13,15 @@ def test_basic_oid():
|
|||
assert ObjectIdentifier("1.2.3.4").dotted_string == "1.2.3.4"
|
||||
|
||||
|
||||
def test_oid_equal():
|
||||
assert ObjectIdentifier("1.2.3.4") == ObjectIdentifier("1.2.3.4")
|
||||
|
||||
|
||||
def test_oid_deepcopy():
|
||||
oid = ObjectIdentifier("1.2.3.4")
|
||||
assert oid == copy.deepcopy(oid)
|
||||
|
||||
|
||||
def test_oid_constraint():
|
||||
# Too short
|
||||
with pytest.raises(ValueError):
|
||||
|
|
|
|||
Loading…
Reference in a new issue