aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-10 09:58:29 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-10 09:58:29 -0500
commit749da3b67c76ca7172eef88b2624b46cb99510a9 (patch)
treecf6029de76cecaf9a1268b576ac1f39b143513cd
parent96ef63c9996612caea7342cf78c0abb57564989c (diff)
downloadcryptography-749da3b67c76ca7172eef88b2624b46cb99510a9.tar.gz
cryptography-749da3b67c76ca7172eef88b2624b46cb99510a9.tar.bz2
cryptography-749da3b67c76ca7172eef88b2624b46cb99510a9.zip
repr tests are the worst. frozenset has diff repr on py3
-rw-r--r--tests/test_x509_ext.py46
1 files changed, 32 insertions, 14 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 58fb3c46..06a68600 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -1453,14 +1453,24 @@ class TestDistributionPoint(object):
)
],
)
- assert repr(dp) == (
- "<DistributionPoint(full_name=None, relative_name=<Name([<NameAtt"
- "ribute(oid=<ObjectIdentifier(oid=2.5.4.3, name=commonName)>, val"
- "ue='myCN')>])>, reasons=frozenset([<ReasonFlags.ca_compromise: '"
- "cACompromise'>]), crl_issuer=[<DirectoryName(value=<Name([<NameA"
- "ttribute(oid=<ObjectIdentifier(oid=2.5.4.3, name=commonName)>, v"
- "alue='Important CA')>])>)>])>"
- )
+ if six.PY3:
+ assert repr(dp) == (
+ "<DistributionPoint(full_name=None, relative_name=<Name([<Name"
+ "Attribute(oid=<ObjectIdentifier(oid=2.5.4.3, name=commonName)"
+ ">, value='myCN')>])>, reasons=frozenset({<ReasonFlags.ca_comp"
+ "romise: 'cACompromise'>}), crl_issuer=[<DirectoryName(value=<"
+ "Name([<NameAttribute(oid=<ObjectIdentifier(oid=2.5.4.3, name="
+ "commonName)>, value='Important CA')>])>)>])>"
+ )
+ else:
+ assert repr(dp) == (
+ "<DistributionPoint(full_name=None, relative_name=<Name([<Name"
+ "Attribute(oid=<ObjectIdentifier(oid=2.5.4.3, name=commonName)"
+ ">, value='myCN')>])>, reasons=frozenset([<ReasonFlags.ca_comp"
+ "romise: 'cACompromise'>]), crl_issuer=[<DirectoryName(value=<"
+ "Name([<NameAttribute(oid=<ObjectIdentifier(oid=2.5.4.3, name="
+ "commonName)>, value='Important CA')>])>)>])>"
+ )
class TestCRLDistributionPoints(object):
@@ -1514,12 +1524,20 @@ class TestCRLDistributionPoints(object):
None
),
])
- assert repr(cdp) == (
- "<CRLDistributionPoints([<DistributionPoint(full_name=[<UniformRes"
- "ourceIdentifier(value=ftp://domain)>], relative_name=None, reason"
- "s=frozenset([<ReasonFlags.key_compromise: 'keyCompromise'>]), crl"
- "_issuer=None)>])>"
- )
+ if six.PY3:
+ assert repr(cdp) == (
+ "<CRLDistributionPoints([<DistributionPoint(full_name=[<Unifo"
+ "rmResourceIdentifier(value=ftp://domain)>], relative_name=No"
+ "ne, reasons=frozenset({<ReasonFlags.key_compromise: 'keyComp"
+ "romise'>}), crl_issuer=None)>])>"
+ )
+ else:
+ assert repr(cdp) == (
+ "<CRLDistributionPoints([<DistributionPoint(full_name=[<Unifo"
+ "rmResourceIdentifier(value=ftp://domain)>], relative_name=No"
+ "ne, reasons=frozenset([<ReasonFlags.key_compromise: 'keyComp"
+ "romise'>]), crl_issuer=None)>])>"
+ )
def test_eq(self):
cdp = x509.CRLDistributionPoints([