@@ -33,12 +33,10 @@ def testUsingTestData(self):
33
33
new_object = ds .object_from_string (ds_data .TEST_OBJECT )
34
34
assert new_object .id == "object_id"
35
35
assert new_object .encoding == ds .ENCODING_BASE64
36
- assert new_object .text .strip () == \
37
- "V2VkIEp1biAgNCAxMjoxMTowMyBFRFQgMjAwMwo"
38
-
36
+ assert new_object .text .strip () == "V2VkIEp1biAgNCAxMjoxMTowMyBFRFQgMjAwMwo"
39
37
40
- class TestMgmtData :
41
38
39
+ class TestMgmtData :
42
40
def setup_class (self ):
43
41
self .mgmt_data = ds .MgmtData ()
44
42
@@ -156,7 +154,7 @@ def testAccessors(self):
156
154
self .x509_data .x509_certificate = ds .X509Certificate (
157
155
text = "x509 certificate" )
158
156
self .x509_data .x509_crl = ds .X509CRL (text = "x509 crl" )
159
-
157
+
160
158
new_x509_data = ds .x509_data_from_string (self .x509_data .to_string ())
161
159
print (new_x509_data .keyswv ())
162
160
print (new_x509_data .__dict__ .keys ())
@@ -231,7 +229,7 @@ def testAccessors(self):
231
229
ds .TRANSFORM_ENVELOPED
232
230
assert new_transforms .transform [0 ].x_path [0 ].text .strip () == "xpath"
233
231
assert new_transforms .transform [1 ].x_path [0 ].text .strip () == "xpath"
234
-
232
+
235
233
def testUsingTestData (self ):
236
234
"""Test for transform_from_string() using test data"""
237
235
new_transforms = ds .transforms_from_string (ds_data .TEST_TRANSFORMS )
@@ -261,7 +259,7 @@ def testAccessors(self):
261
259
assert new_retrieval_method .uri == "http://www.example.com/URI"
262
260
assert new_retrieval_method .type == "http://www.example.com/Type"
263
261
assert isinstance (new_retrieval_method .transforms , ds .Transforms )
264
-
262
+
265
263
def testUsingTestData (self ):
266
264
"""Test for retrieval_method_from_string() using test data"""
267
265
new_retrieval_method = ds .retrieval_method_from_string (
@@ -285,7 +283,7 @@ def testAccessors(self):
285
283
assert isinstance (new_rsa_key_value .exponent , ds .Exponent )
286
284
assert new_rsa_key_value .modulus .text .strip () == "modulus"
287
285
assert new_rsa_key_value .exponent .text .strip () == "exponent"
288
-
286
+
289
287
def testUsingTestData (self ):
290
288
"""Test for rsa_key_value_from_string() using test data"""
291
289
new_rsa_key_value = ds .rsa_key_value_from_string (
@@ -325,7 +323,7 @@ def testAccessors(self):
325
323
assert new_dsa_key_value .j .text .strip () == "j"
326
324
assert new_dsa_key_value .seed .text .strip () == "seed"
327
325
assert new_dsa_key_value .pgen_counter .text .strip () == "pgen counter"
328
-
326
+
329
327
def testUsingTestData (self ):
330
328
"""Test for dsa_key_value_from_string() using test data"""
331
329
new_dsa_key_value = ds .dsa_key_value_from_string (
@@ -362,7 +360,7 @@ def testAccessors(self):
362
360
ds_data .TEST_RSA_KEY_VALUE )
363
361
new_key_value = ds .key_value_from_string (self .key_value .to_string ())
364
362
assert isinstance (new_key_value .rsa_key_value , ds .RSAKeyValue )
365
-
363
+
366
364
def testUsingTestData (self ):
367
365
"""Test for key_value_from_string() using test data"""
368
366
new_key_value = ds .key_value_from_string (ds_data .TEST_KEY_VALUE1 )
@@ -384,7 +382,7 @@ def testAccessors(self):
384
382
self .key_name .text = "key name"
385
383
new_key_name = ds .key_name_from_string (self .key_name .to_string ())
386
384
assert new_key_name .text .strip () == "key name"
387
-
385
+
388
386
def testUsingTestData (self ):
389
387
"""Test for key_name_from_string() using test data"""
390
388
new_key_name = ds .key_name_from_string (ds_data .TEST_KEY_NAME )
@@ -423,7 +421,7 @@ def testAccessors(self):
423
421
assert isinstance (new_key_info .spki_data [0 ], ds .SPKIData )
424
422
assert isinstance (new_key_info .mgmt_data [0 ], ds .MgmtData )
425
423
assert new_key_info .id == "id"
426
-
424
+
427
425
def testUsingTestData (self ):
428
426
"""Test for key_info_from_string() using test data"""
429
427
new_key_info = ds .key_info_from_string (ds_data .TEST_KEY_INFO )
@@ -436,7 +434,7 @@ def testUsingTestData(self):
436
434
assert isinstance (new_key_info .spki_data [0 ], ds .SPKIData )
437
435
assert isinstance (new_key_info .mgmt_data [0 ], ds .MgmtData )
438
436
assert new_key_info .id == "id"
439
-
437
+
440
438
441
439
class TestDigestValue :
442
440
@@ -448,7 +446,7 @@ def testAccessors(self):
448
446
self .digest_value .text = "digest value"
449
447
new_digest_value = ds .digest_value_from_string (self .digest_value .to_string ())
450
448
assert new_digest_value .text .strip () == "digest value"
451
-
449
+
452
450
def testUsingTestData (self ):
453
451
"""Test for digest_value_from_string() using test data"""
454
452
new_digest_value = ds .digest_value_from_string (ds_data .TEST_DIGEST_VALUE )
@@ -466,7 +464,7 @@ def testAccessors(self):
466
464
new_digest_method = ds .digest_method_from_string (
467
465
self .digest_method .to_string ())
468
466
assert new_digest_method .algorithm == ds .DIGEST_SHA1
469
-
467
+
470
468
def testUsingTestData (self ):
471
469
"""Test for digest_method_from_string() using test data"""
472
470
new_digest_method = ds .digest_method_from_string (
@@ -497,7 +495,7 @@ def testAccessors(self):
497
495
assert new_reference .id == "id"
498
496
assert new_reference .uri == "http://www.example.com/URI"
499
497
assert new_reference .type == "http://www.example.com/Type"
500
-
498
+
501
499
def testUsingTestData (self ):
502
500
"""Test for reference_from_string() using test data"""
503
501
new_reference = ds .reference_from_string (ds_data .TEST_REFERENCE )
@@ -524,7 +522,7 @@ def testAccessors(self):
524
522
ds .HMACOutputLength )
525
523
assert new_signature_method .hmac_output_length .text .strip () == "8"
526
524
assert new_signature_method .algorithm == ds .SIG_RSA_SHA1
527
-
525
+
528
526
def testUsingTestData (self ):
529
527
"""Test for signature_method_from_string() using test data"""
530
528
new_signature_method = ds .signature_method_from_string (
@@ -542,16 +540,17 @@ def setup_class(self):
542
540
543
541
def testAccessors (self ):
544
542
"""Test for CanonicalizationMethod accessors"""
545
- self .canonicalization_method .algorithm = ds .C14N_WITH_C
543
+ self .canonicalization_method .algorithm = ds .TRANSFORM_C14N_WITH_COMMENTS
546
544
new_canonicalization_method = ds .canonicalization_method_from_string (
547
545
self .canonicalization_method .to_string ())
548
- assert new_canonicalization_method .algorithm == ds .C14N_WITH_C
549
-
546
+ assert new_canonicalization_method .algorithm == ds .TRANSFORM_C14N_WITH_COMMENTS
547
+
550
548
def testUsingTestData (self ):
551
549
"""Test for canonicalization_method_from_string() using test data"""
552
550
new_canonicalization_method = ds .canonicalization_method_from_string (
553
- ds_data .TEST_CANONICALIZATION_METHOD )
554
- assert new_canonicalization_method .algorithm == ds .C14N_WITH_C
551
+ ds_data .TEST_CANONICALIZATION_METHOD
552
+ )
553
+ assert new_canonicalization_method .algorithm == "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"
555
554
556
555
557
556
class TestSignedInfo :
@@ -574,7 +573,7 @@ def testAccessors(self):
574
573
ds .CanonicalizationMethod )
575
574
assert isinstance (new_si .signature_method , ds .SignatureMethod )
576
575
assert isinstance (new_si .reference [0 ], ds .Reference )
577
-
576
+
578
577
def testUsingTestData (self ):
579
578
"""Test for signed_info_from_string() using test data"""
580
579
new_si = ds .signed_info_from_string (ds_data .TEST_SIGNED_INFO )
@@ -597,7 +596,7 @@ def testAccessors(self):
597
596
self .signature_value .to_string ())
598
597
assert new_signature_value .id == "id"
599
598
assert new_signature_value .text .strip () == "signature value"
600
-
599
+
601
600
def testUsingTestData (self ):
602
601
"""Test for signature_value_from_string() using test data"""
603
602
new_signature_value = ds .signature_value_from_string (
@@ -627,7 +626,7 @@ def testAccessors(self):
627
626
assert isinstance (new_signature .signature_value , ds .SignatureValue )
628
627
assert isinstance (new_signature .key_info , ds .KeyInfo )
629
628
assert isinstance (new_signature .object [0 ], ds .Object )
630
-
629
+
631
630
def testUsingTestData (self ):
632
631
"""Test for signature_value_from_string() using test data"""
633
632
new_signature = ds .signature_from_string (ds_data .TEST_SIGNATURE )
0 commit comments