@@ -259,7 +259,7 @@ def test_category_list(self, mock_get):
259
259
260
260
# assert
261
261
mock_get .assert_called_with ("/rest/com/vmware/cis/tagging/category" )
262
- self .assertEquals (result , expected )
262
+ self .assertEqual (result , expected )
263
263
264
264
@mock .patch ("vmwarelib.tagging.VmwareTagging.get" )
265
265
def test_category_get (self , mock_get ):
@@ -274,7 +274,7 @@ def test_category_get(self, mock_get):
274
274
275
275
# assert
276
276
mock_get .assert_called_with ("/rest/com/vmware/cis/tagging/category/id:1234" )
277
- self .assertEquals (result , expected )
277
+ self .assertEqual (result , expected )
278
278
279
279
@mock .patch ("vmwarelib.tagging.VmwareTagging.delete" )
280
280
def test_category_delete (self , mock_delete ):
@@ -289,7 +289,7 @@ def test_category_delete(self, mock_delete):
289
289
290
290
# assert
291
291
mock_delete .assert_called_with ("/rest/com/vmware/cis/tagging/category/id:1234" )
292
- self .assertEquals (result , expected )
292
+ self .assertEqual (result , expected )
293
293
294
294
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_get" )
295
295
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_list" )
@@ -307,7 +307,7 @@ def test_category_find_by_name(self, mock_category_list, mock_category_get):
307
307
result = action .category_find_by_name ("b" )
308
308
309
309
# assert
310
- self .assertEquals (result , {"name" : "b" , "value" : "xx" })
310
+ self .assertEqual (result , {"name" : "b" , "value" : "xx" })
311
311
312
312
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_get" )
313
313
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_list" )
@@ -325,15 +325,15 @@ def test_category_find_by_name_not_found(self, mock_category_list, mock_category
325
325
result = action .category_find_by_name ("abc123" )
326
326
327
327
# assert
328
- self .assertEquals (result , None )
328
+ self .assertEqual (result , None )
329
329
330
330
def test_category_create_spec (self ):
331
331
action = self .create_class_object ()
332
332
create_spec = action .category_create_spec ()
333
- self .assertEquals (create_spec , {"name" : "" ,
334
- "description" : "" ,
335
- "cardinality" : "SINGLE" ,
336
- "associable_types" : []})
333
+ self .assertEqual (create_spec , {"name" : "" ,
334
+ "description" : "" ,
335
+ "cardinality" : "SINGLE" ,
336
+ "associable_types" : []})
337
337
338
338
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
339
339
def test_category_create_all_params (self , mock_post ):
@@ -360,7 +360,7 @@ def test_category_create_all_params(self, mock_post):
360
360
# assert
361
361
mock_post .assert_called_with ("/rest/com/vmware/cis/tagging/category" ,
362
362
payload = {"create_spec" : expected_create_spec })
363
- self .assertEquals (result , "expected result" )
363
+ self .assertEqual (result , "expected result" )
364
364
365
365
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
366
366
def test_category_create_no_params (self , mock_post ):
@@ -382,7 +382,7 @@ def test_category_create_no_params(self, mock_post):
382
382
# assert
383
383
mock_post .assert_called_with ("/rest/com/vmware/cis/tagging/category" ,
384
384
payload = {"create_spec" : expected_create_spec })
385
- self .assertEquals (result , "expected result" )
385
+ self .assertEqual (result , "expected result" )
386
386
387
387
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_find_by_name" )
388
388
def test_category_get_or_create_get (self , mock_category_find_by_name ):
@@ -397,7 +397,7 @@ def test_category_get_or_create_get(self, mock_category_find_by_name):
397
397
398
398
# assert
399
399
mock_category_find_by_name .assert_called_with ("name" )
400
- self .assertEquals (result , "fake category" )
400
+ self .assertEqual (result , "fake category" )
401
401
402
402
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_get" )
403
403
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_create" )
@@ -426,7 +426,7 @@ def test_category_get_or_create_create_all_params(self, mock_category_find_by_na
426
426
mock_category_create .assert_called_with (test_name , test_description , test_cardinality ,
427
427
test_associable_types )
428
428
mock_category_get .assert_called_with ("123" )
429
- self .assertEquals (result , "fake category" )
429
+ self .assertEqual (result , "fake category" )
430
430
431
431
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_get" )
432
432
@mock .patch ("vmwarelib.tagging.VmwareTagging.category_create" )
@@ -450,7 +450,7 @@ def test_category_get_or_create_create_no_params(self, mock_category_find_by_nam
450
450
mock_category_find_by_name .assert_called_with (test_name )
451
451
mock_category_create .assert_called_with (test_name , None , None , None )
452
452
mock_category_get .assert_called_with ("123" )
453
- self .assertEquals (result , "fake category" )
453
+ self .assertEqual (result , "fake category" )
454
454
455
455
############################################################################
456
456
@@ -470,7 +470,7 @@ def test_tag_list_category(self, mock_post):
470
470
# assert
471
471
mock_post .assert_called_with ("/rest/com/vmware/cis/tagging/tag/id:1234" ,
472
472
params = {"~action" : "list-tags-for-category" })
473
- self .assertEquals (result , expected )
473
+ self .assertEqual (result , expected )
474
474
475
475
@mock .patch ("vmwarelib.tagging.VmwareTagging.get" )
476
476
def test_tag_list_no_category (self , mock_get ):
@@ -484,7 +484,7 @@ def test_tag_list_no_category(self, mock_get):
484
484
485
485
# assert
486
486
mock_get .assert_called_with ("/rest/com/vmware/cis/tagging/tag" )
487
- self .assertEquals (result , expected )
487
+ self .assertEqual (result , expected )
488
488
489
489
@mock .patch ("vmwarelib.tagging.VmwareTagging.get" )
490
490
def test_tag_get (self , mock_get ):
@@ -499,7 +499,7 @@ def test_tag_get(self, mock_get):
499
499
500
500
# assert
501
501
mock_get .assert_called_with ("/rest/com/vmware/cis/tagging/tag/id:1234" )
502
- self .assertEquals (result , expected )
502
+ self .assertEqual (result , expected )
503
503
504
504
@mock .patch ("vmwarelib.tagging.VmwareTagging.delete" )
505
505
def test_tag_delete (self , mock_delete ):
@@ -514,7 +514,7 @@ def test_tag_delete(self, mock_delete):
514
514
515
515
# assert
516
516
mock_delete .assert_called_with ("/rest/com/vmware/cis/tagging/tag/id:1234" )
517
- self .assertEquals (result , expected )
517
+ self .assertEqual (result , expected )
518
518
519
519
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_get" )
520
520
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_list" )
@@ -535,7 +535,7 @@ def test_tag_find_by_name(self, mock_tag_list, mock_tag_get):
535
535
536
536
# assert
537
537
mock_tag_list .assert_called_with (test_category_id )
538
- self .assertEquals (result , {"name" : "b" , "value" : "xx" })
538
+ self .assertEqual (result , {"name" : "b" , "value" : "xx" })
539
539
540
540
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_get" )
541
541
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_list" )
@@ -557,14 +557,14 @@ def test_tag_find_not_found(self, mock_tag_list, mock_tag_get):
557
557
mock_tag_list .assert_called_with (None )
558
558
mock_tag_get .assert_has_calls ([mock .call ("1" ), mock .call ("2" ), mock .call ("3" )],
559
559
any_order = True )
560
- self .assertEquals (result , None )
560
+ self .assertEqual (result , None )
561
561
562
562
def test_tag_create_spec (self ):
563
563
action = self .create_class_object ()
564
564
create_spec = action .tag_create_spec ()
565
- self .assertEquals (create_spec , {"name" : "" ,
566
- "description" : "" ,
567
- "category_id" : "" })
565
+ self .assertEqual (create_spec , {"name" : "" ,
566
+ "description" : "" ,
567
+ "category_id" : "" })
568
568
569
569
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
570
570
def test_tag_create (self , mock_post ):
@@ -585,7 +585,7 @@ def test_tag_create(self, mock_post):
585
585
# assert
586
586
mock_post .assert_called_with ("/rest/com/vmware/cis/tagging/tag" ,
587
587
payload = {"create_spec" : expected_create_spec })
588
- self .assertEquals (result , "expected result" )
588
+ self .assertEqual (result , "expected result" )
589
589
590
590
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_find_by_name" )
591
591
def test_tag_get_or_create_get (self , mock_tag_find_by_name ):
@@ -602,7 +602,7 @@ def test_tag_get_or_create_get(self, mock_tag_find_by_name):
602
602
603
603
# assert
604
604
mock_tag_find_by_name .assert_called_with (test_tag_name , test_category_id )
605
- self .assertEquals (result , "fake tag" )
605
+ self .assertEqual (result , "fake tag" )
606
606
607
607
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_get" )
608
608
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_create" )
@@ -623,7 +623,7 @@ def test_tag_get_or_create_create(self, mock_tag_find_by_name,
623
623
mock_tag_find_by_name .assert_called_with (test_tag_name , test_category_id )
624
624
mock_tag_create .assert_called_with (test_tag_name , test_category_id , None )
625
625
mock_tag_get .assert_called_with ("123" )
626
- self .assertEquals (result , "fake tag" )
626
+ self .assertEqual (result , "fake tag" )
627
627
628
628
############################################################################
629
629
@@ -632,14 +632,14 @@ def test_tag_get_or_create_create(self, mock_tag_find_by_name,
632
632
def test_tag_association_endpoint (self ):
633
633
action = self .create_class_object ()
634
634
result = action .tag_association_endpoint ()
635
- self .assertEquals (result ,
636
- "/rest/com/vmware/cis/tagging/tag-association" )
635
+ self .assertEqual (result ,
636
+ "/rest/com/vmware/cis/tagging/tag-association" )
637
637
638
638
def test_tag_association_endpoint_tag_id (self ):
639
639
action = self .create_class_object ()
640
640
result = action .tag_association_endpoint ("123" )
641
- self .assertEquals (result ,
642
- "/rest/com/vmware/cis/tagging/tag-association/id:123" )
641
+ self .assertEqual (result ,
642
+ "/rest/com/vmware/cis/tagging/tag-association/id:123" )
643
643
644
644
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
645
645
def test_tag_association_attach (self , mock_post ):
@@ -651,7 +651,7 @@ def test_tag_association_attach(self, mock_post):
651
651
params = {'~action' : "attach" },
652
652
payload = {"object_id" : {"id" : "vm-789" ,
653
653
"type" : "vm" }})
654
- self .assertEquals (result , "response" )
654
+ self .assertEqual (result , "response" )
655
655
656
656
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
657
657
def test_tag_association_attach_multiple (self , mock_post ):
@@ -665,7 +665,7 @@ def test_tag_association_attach_multiple(self, mock_post):
665
665
payload = {"tag_ids" : test_tag_ids ,
666
666
"object_id" : {"id" : "vm-789" ,
667
667
"type" : "vm" }})
668
- self .assertEquals (result , "response" )
668
+ self .assertEqual (result , "response" )
669
669
670
670
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
671
671
def test_tag_association_detach (self , mock_post ):
@@ -677,7 +677,7 @@ def test_tag_association_detach(self, mock_post):
677
677
params = {'~action' : 'detach' },
678
678
payload = {"object_id" : {"id" : "vm-789" ,
679
679
"type" : "vm" }})
680
- self .assertEquals (result , "response" )
680
+ self .assertEqual (result , "response" )
681
681
682
682
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
683
683
def test_tag_association_list_attached_tags (self , mock_post ):
@@ -689,7 +689,7 @@ def test_tag_association_list_attached_tags(self, mock_post):
689
689
params = {'~action' : 'list-attached-tags' },
690
690
payload = {"object_id" : {"id" : "vm-789" ,
691
691
"type" : "vm" }})
692
- self .assertEquals (result , "response" )
692
+ self .assertEqual (result , "response" )
693
693
694
694
@mock .patch ("vmwarelib.tagging.VmwareTagging.post" )
695
695
def test_tag_association_list_attached_objects (self , mock_post ):
@@ -699,7 +699,7 @@ def test_tag_association_list_attached_objects(self, mock_post):
699
699
700
700
mock_post .assert_called_with ("/rest/com/vmware/cis/tagging/tag-association/id:123" ,
701
701
params = {'~action' : 'list-attached-objects' })
702
- self .assertEquals (result , "response" )
702
+ self .assertEqual (result , "response" )
703
703
704
704
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_association_detach" )
705
705
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_get" )
@@ -714,7 +714,7 @@ def test_tag_association_detach_category(self, mock_tag_association_list_attache
714
714
{"name" : "3" , "category_id" : "c2" }]
715
715
716
716
results = action .tag_association_detach_category ("c2" , "vm" , "vm-123" )
717
- self .assertEquals (results , [{"name" : "3" , "category_id" : "c2" }])
717
+ self .assertEqual (results , [{"name" : "3" , "category_id" : "c2" }])
718
718
719
719
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_association_detach" )
720
720
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_get" )
@@ -730,7 +730,7 @@ def test_tag_association_detach_category_no_match(self,
730
730
{"name" : "3" , "category_id" : "c2" }]
731
731
732
732
results = action .tag_association_detach_category ("xyz" , "vm" , "vm-123" )
733
- self .assertEquals (results , [])
733
+ self .assertEqual (results , [])
734
734
735
735
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_association_attach" )
736
736
@mock .patch ("vmwarelib.tagging.VmwareTagging.tag_association_detach_category" )
@@ -751,4 +751,4 @@ def test_tag_association_replace(self, mock_tag_get,
751
751
mock_tag_association_attach .assert_called_with ("123" ,
752
752
"vm" ,
753
753
"vm-789" )
754
- self .assertEquals (results , "expected" )
754
+ self .assertEqual (results , "expected" )
0 commit comments