@@ -67,7 +67,7 @@ def testSetter_ReadOnly(self):
67
67
# Testing
68
68
with self .assertRaises (DOMException ) as context_manager :
69
69
text .node_value = 'bar'
70
- self .assertEqual (context_manager .exception .args [ 0 ] ,
70
+ self .assertEqual (context_manager .exception .code ,
71
71
DOMException .NO_MODIFICATION_ALLOWED_ERR )
72
72
# `node_value` should not be modified.
73
73
self .assertEqual (text .node_value , 'foo' )
@@ -238,7 +238,7 @@ def test_Raises_WRONG_DOCUMENT_ERR(self):
238
238
# Testing
239
239
with self .assertRaises (DOMException ) as context_manager :
240
240
elem_node_1 .insert_before (elem_node_2 )
241
- self .assertEqual (context_manager .exception .args [ 0 ] ,
241
+ self .assertEqual (context_manager .exception .code ,
242
242
DOMException .WRONG_DOCUMENT_ERR )
243
243
244
244
def test_Raises_NO_MODIFICATION_ALLOWED_ERR (self ):
@@ -256,7 +256,7 @@ def test_Raises_NO_MODIFICATION_ALLOWED_ERR(self):
256
256
# Testing
257
257
with self .assertRaises (DOMException ) as context_manager :
258
258
parent_node_readonly .insert_before (new_child_node )
259
- self .assertEqual (context_manager .exception .args [ 0 ] ,
259
+ self .assertEqual (context_manager .exception .code ,
260
260
DOMException .NO_MODIFICATION_ALLOWED_ERR )
261
261
262
262
def test_Raises_NOT_FOUND_ERR (self ):
@@ -273,7 +273,7 @@ def test_Raises_NOT_FOUND_ERR(self):
273
273
# Testing
274
274
with self .assertRaises (DOMException ) as context_manager :
275
275
parent_node .insert_before (new_child_node , ref_child_node )
276
- self .assertEqual (context_manager .exception .args [ 0 ] ,
276
+ self .assertEqual (context_manager .exception .code ,
277
277
DOMException .NOT_FOUND_ERR )
278
278
279
279
@@ -363,7 +363,7 @@ def test_Raises_WRONG_DOCUMENT_ERR(self):
363
363
# Testing
364
364
with self .assertRaises (DOMException ) as context_manager :
365
365
elem_node_1 .append_child (elem_node_2 )
366
- self .assertEqual (context_manager .exception .args [ 0 ] ,
366
+ self .assertEqual (context_manager .exception .code ,
367
367
DOMException .WRONG_DOCUMENT_ERR )
368
368
369
369
def test_Raises_NO_MODIFICATION_ALLOWED_ERR (self ):
@@ -381,7 +381,7 @@ def test_Raises_NO_MODIFICATION_ALLOWED_ERR(self):
381
381
# Testing
382
382
with self .assertRaises (DOMException ) as context_manager :
383
383
parent_node_readonly .append_child (new_child_node )
384
- self .assertEqual (context_manager .exception .args [ 0 ] ,
384
+ self .assertEqual (context_manager .exception .code ,
385
385
DOMException .NO_MODIFICATION_ALLOWED_ERR )
386
386
387
387
@@ -436,7 +436,7 @@ def test_Raises_WRONG_DOCUMENT_ERR(self):
436
436
# Testing
437
437
with self .assertRaises (DOMException ) as context_manager :
438
438
parent_node .replace_child (new_child_node , old_child_node )
439
- self .assertEqual (context_manager .exception .args [ 0 ] ,
439
+ self .assertEqual (context_manager .exception .code ,
440
440
DOMException .WRONG_DOCUMENT_ERR )
441
441
442
442
def test_Raises_NO_MODIFICATION_ALLOWED_ERR (self ):
@@ -454,7 +454,7 @@ def test_Raises_NO_MODIFICATION_ALLOWED_ERR(self):
454
454
# Testing
455
455
with self .assertRaises (DOMException ) as context_manager :
456
456
parent_node_readonly .append_child (new_child_node )
457
- self .assertEqual (context_manager .exception .args [ 0 ] ,
457
+ self .assertEqual (context_manager .exception .code ,
458
458
DOMException .NO_MODIFICATION_ALLOWED_ERR )
459
459
460
460
@@ -521,7 +521,7 @@ def test_Raises_NOT_FOUND_ERR(self):
521
521
# Testing
522
522
with self .assertRaises (DOMException ) as context_manager :
523
523
parent_node .remove_child (child_node )
524
- self .assertEqual (context_manager .exception .args [ 0 ] ,
524
+ self .assertEqual (context_manager .exception .code ,
525
525
DOMException .NOT_FOUND_ERR )
526
526
527
527
def test_Raises_NO_MODIFICATION_ALLOWED_ERR (self ):
@@ -541,7 +541,7 @@ def test_Raises_NO_MODIFICATION_ALLOWED_ERR(self):
541
541
# Testing
542
542
with self .assertRaises (DOMException ) as context_manager :
543
543
parent_node .remove_child (child_node )
544
- self .assertEqual (context_manager .exception .args [ 0 ] ,
544
+ self .assertEqual (context_manager .exception .code ,
545
545
DOMException .NO_MODIFICATION_ALLOWED_ERR )
546
546
547
547
0 commit comments