Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix deprecation warnings
  • Loading branch information
acoburn committed Mar 2, 2022
commit e51bd1ecb218afcc761aa93a6c32b8dd54f4d0db
8 changes: 4 additions & 4 deletions tests/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ def test_notification_turtle(self, mock_get):
notification = Consumer().notification("http://example.org/inbox/1")
self.assertTrue(1, len(notification))
self.assertTrue("@id" in notification[0])
self.assertEquals("http://example.org/inbox/1", notification[0]["@id"])
self.assertEqual("http://example.org/inbox/1", notification[0]["@id"])

prefLabel = "http://www.w3.org/2004/02/skos/core#prefLabel"
self.assertTrue(prefLabel in notification[0])
self.assertEquals("First notification",
self.assertEqual("First notification",
notification[0][prefLabel][0]["@value"])

@patch('requests.get')
Expand All @@ -111,7 +111,7 @@ def test_notification_jsonld(self, mock_get):
notification = Consumer().notification("http://example.org/inbox/1")
self.assertTrue(1, len(notification))
self.assertTrue("@id" in notification[0])
self.assertEquals("http://example.org/inbox/1", notification[0]["@id"])
self.assertEqual("http://example.org/inbox/1", notification[0]["@id"])
self.assertTrue("creator" in notification[0])
self.assertEquals("http://example.org/user",
self.assertEqual("http://example.org/user",
notification[0]["creator"])
8 changes: 4 additions & 4 deletions tests/test_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_send_string(self, mock_post):
data = f.read()

Sender().send(self.INBOX, data)
self.assertEquals(str, type(data))
self.assertEqual(str, type(data))
mock_post.assert_called_once_with(self.INBOX, data=data,
headers=self.HEADERS)

Expand All @@ -29,7 +29,7 @@ def test_send_dict(self, mock_post):
data = json.loads(f.read())

Sender().send(self.INBOX, data)
self.assertEquals(dict, type(data))
self.assertEqual(dict, type(data))
mock_post.assert_called_once_with(self.INBOX, data=json.dumps(data),
headers=self.HEADERS)

Expand All @@ -40,7 +40,7 @@ def test_send_list(self, mock_post):
data = json.loads("[" + f.read() + "]")

Sender().send(self.INBOX, data)
self.assertEquals(list, type(data))
self.assertEqual(list, type(data))
mock_post.assert_called_once_with(self.INBOX, data=json.dumps(data),
headers=self.HEADERS)

Expand All @@ -49,6 +49,6 @@ def test_send_graph(self, mock_post):
data = Graph().parse("tests/notification.nt", format="ntriples")

Sender().send(self.INBOX, data)
self.assertEquals(Graph, type(data))
self.assertEqual(Graph, type(data))
mock_post.assert_called_once_with(self.INBOX, data=data.serialize(
format="application/ld+json"), headers=self.HEADERS)