diff --git a/.github/workflows/ci-config.yml b/.github/workflows/ci-config.yml index 738294f..e81e378 100644 --- a/.github/workflows/ci-config.yml +++ b/.github/workflows/ci-config.yml @@ -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 diff --git a/ldnlib/consumer.py b/ldnlib/consumer.py index 5acaea1..5a8fcf9 100644 --- a/ldnlib/consumer.py +++ b/ldnlib/consumer.py @@ -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")) diff --git a/tests/test_consumer.py b/tests/test_consumer.py index ecd395b..375cd6b 100644 --- a/tests/test_consumer.py +++ b/tests/test_consumer.py @@ -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): @@ -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"]) diff --git a/tests/test_sender.py b/tests/test_sender.py index 5583255..b0edf34 100644 --- a/tests/test_sender.py +++ b/tests/test_sender.py @@ -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) @@ -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) @@ -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) @@ -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)