Skip to content

Commit 21cfafd

Browse files
authored
Use more recent python versions (#5)
1 parent 1bf439e commit 21cfafd

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.github/workflows/ci-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: [3.4, 3.5, 3.6, 3.7, 3.8]
16+
python-version: ['3.8', '3.9', '3.10']
1717

1818
steps:
1919
- uses: actions/checkout@v2

ldnlib/consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ def notification(self, iri, **kwargs):
4040
return r.json()
4141
else:
4242
g = Graph().parse(data=r.text, format=mime_type)
43-
return json.loads(str(g.serialize(format="json-ld"), 'utf-8'))
43+
return json.loads(g.serialize(format="json-ld"))

tests/test_consumer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ def test_notification_turtle(self, mock_get):
9191
notification = Consumer().notification("http://example.org/inbox/1")
9292
self.assertTrue(1, len(notification))
9393
self.assertTrue("@id" in notification[0])
94-
self.assertEquals("http://example.org/inbox/1", notification[0]["@id"])
94+
self.assertEqual("http://example.org/inbox/1", notification[0]["@id"])
9595

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

101101
@patch('requests.get')
102102
def test_notification_jsonld(self, mock_get):
@@ -111,7 +111,7 @@ def test_notification_jsonld(self, mock_get):
111111
notification = Consumer().notification("http://example.org/inbox/1")
112112
self.assertTrue(1, len(notification))
113113
self.assertTrue("@id" in notification[0])
114-
self.assertEquals("http://example.org/inbox/1", notification[0]["@id"])
114+
self.assertEqual("http://example.org/inbox/1", notification[0]["@id"])
115115
self.assertTrue("creator" in notification[0])
116-
self.assertEquals("http://example.org/user",
117-
notification[0]["creator"])
116+
self.assertEqual("http://example.org/user",
117+
notification[0]["creator"])

tests/test_sender.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_send_string(self, mock_post):
1818
data = f.read()
1919

2020
Sender().send(self.INBOX, data)
21-
self.assertEquals(str, type(data))
21+
self.assertEqual(str, type(data))
2222
mock_post.assert_called_once_with(self.INBOX, data=data,
2323
headers=self.HEADERS)
2424

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

3131
Sender().send(self.INBOX, data)
32-
self.assertEquals(dict, type(data))
32+
self.assertEqual(dict, type(data))
3333
mock_post.assert_called_once_with(self.INBOX, data=json.dumps(data),
3434
headers=self.HEADERS)
3535

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

4242
Sender().send(self.INBOX, data)
43-
self.assertEquals(list, type(data))
43+
self.assertEqual(list, type(data))
4444
mock_post.assert_called_once_with(self.INBOX, data=json.dumps(data),
4545
headers=self.HEADERS)
4646

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

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

0 commit comments

Comments
 (0)