Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.4, 3.5, 3.6, 3.7, 3.8]
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion ldnlib/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def notification(self, iri, **kwargs):
return r.json()
else:
g = Graph().parse(data=r.text, format=mime_type)
return json.loads(str(g.serialize(format="json-ld"), 'utf-8'))
return json.loads(g.serialize(format="json-ld"))
12 changes: 6 additions & 6 deletions tests/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ 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",
notification[0][prefLabel][0]["@value"])
self.assertEqual("First notification",
notification[0][prefLabel][0]["@value"])

@patch('requests.get')
def test_notification_jsonld(self, mock_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",
notification[0]["creator"])
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)