Skip to content

Commit 5cb8f17

Browse files
committed
Fix DeprecationWarning: assertDictContainsSubset is deprecated
Replaced with assertLessEqual and remove use of six module.
1 parent 3c5da80 commit 5cb8f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

st2api/tests/unit/controllers/v1/test_actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import mock
2828
import unittest
29-
from six.moves import http_client
29+
import http.client as http_client
3030

3131
from st2common.persistence.action import Action
3232
import st2common.validators.api.action as action_validator
@@ -486,7 +486,7 @@ def test_post_no_enable_field(self):
486486

487487
# If enabled field is not provided it should default to True
488488
data = json.loads(post_resp.body)
489-
self.assertDictContainsSubset({"enabled": True}, data)
489+
self.assertLessEqual({"enabled": True}.items(), data.items())
490490

491491
self.__do_delete(self.__get_action_id(post_resp))
492492

@@ -498,7 +498,7 @@ def test_post_false_enable_field(self):
498498
self.assertEqual(post_resp.status_int, 201)
499499

500500
data = json.loads(post_resp.body)
501-
self.assertDictContainsSubset({"enabled": False}, data)
501+
self.assertLessEqual({"enabled": False}.items(), data.items())
502502

503503
self.__do_delete(self.__get_action_id(post_resp))
504504

0 commit comments

Comments
 (0)