-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: replace deprecated TestCase.assertEquals
`TestCase.assertEquals` is depracated and removed in Python 3.12. Signed-off-by: Benjamin Drung <[email protected]>
- Loading branch information
Showing
3 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- "test: replace deprecated `TestCase.assertEquals` to support Python 3.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,7 +306,7 @@ def test_get_team_method_with_existing_team(self, mock_fetch_url, mock_get_versi | |
}, | ||
method="GET", | ||
) | ||
self.assertEquals(res, {"email": "[email protected]", "name": "MyTestTeam"}) | ||
self.assertEqual(res, {"email": "[email protected]", "name": "MyTestTeam"}) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -341,7 +341,7 @@ def test_get_team_method_with_non_existing_team( | |
}, | ||
method="GET", | ||
) | ||
self.assertEquals(res, None) | ||
self.assertEqual(res, None) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -377,7 +377,7 @@ def test_create_team_method(self, mock_fetch_url, mock_get_version): | |
}, | ||
method="POST", | ||
) | ||
self.assertEquals(res, {"message": "Team created", "teamId": 2}) | ||
self.assertEqual(res, {"message": "Team created", "teamId": 2}) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -412,7 +412,7 @@ def test_update_team_method(self, mock_fetch_url, mock_get_version): | |
}, | ||
method="PUT", | ||
) | ||
self.assertEquals(res, {"message": "Team updated"}) | ||
self.assertEqual(res, {"message": "Team updated"}) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -445,7 +445,7 @@ def test_delete_team_method(self, mock_fetch_url, mock_get_version): | |
}, | ||
method="DELETE", | ||
) | ||
self.assertEquals(res, {"message": "Team deleted"}) | ||
self.assertEqual(res, {"message": "Team deleted"}) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -478,7 +478,7 @@ def test_get_team_members_method(self, mock_fetch_url, mock_get_version): | |
}, | ||
method="GET", | ||
) | ||
self.assertEquals(res, ["[email protected]", "[email protected]"]) | ||
self.assertEqual(res, ["[email protected]", "[email protected]"]) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -513,7 +513,7 @@ def test_get_team_members_method_no_members_returned( | |
}, | ||
method="GET", | ||
) | ||
self.assertEquals(res, []) | ||
self.assertEqual(res, []) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -550,7 +550,7 @@ def test_add_team_member_method(self, mock_fetch_url, mock_get_version): | |
}, | ||
method="POST", | ||
) | ||
self.assertEquals(res, None) | ||
self.assertEqual(res, None) | ||
|
||
@patch( | ||
"ansible_collections.community.grafana.plugins.modules.grafana_team.GrafanaTeamInterface.get_version" | ||
|
@@ -587,13 +587,13 @@ def test_delete_team_member_method(self, mock_fetch_url, mock_get_version): | |
}, | ||
method="DELETE", | ||
) | ||
self.assertEquals(res, None) | ||
self.assertEqual(res, None) | ||
|
||
def test_diff_members_function(self): | ||
list1 = ["[email protected]", "[email protected]"] | ||
list2 = ["[email protected]", "[email protected]"] | ||
|
||
res = grafana_team.diff_members(list1, list2) | ||
self.assertEquals( | ||
self.assertEqual( | ||
res, {"to_del": ["[email protected]"], "to_add": ["[email protected]"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters