From 332a427375fba92696b82df85546d8e67aeed1ae Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Fri, 9 Sep 2022 10:01:57 +0200 Subject: [PATCH] remove simplejson usage from legacy extractor tests --- .../extractors/legacy/tests/test_datacite_xml.py | 4 ++-- datalad_metalad/extractors/tests/test_custom.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datalad_metalad/extractors/legacy/tests/test_datacite_xml.py b/datalad_metalad/extractors/legacy/tests/test_datacite_xml.py index afe5997a..f8c4c48b 100644 --- a/datalad_metalad/extractors/legacy/tests/test_datacite_xml.py +++ b/datalad_metalad/extractors/legacy/tests/test_datacite_xml.py @@ -8,7 +8,7 @@ # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """Test datacite metadata extractor """ -from simplejson import dumps +import json from datalad.api import create from datalad.tests.utils_pytest import ( @@ -73,7 +73,7 @@ def test_get_metadata(path=None): ds.save() meta = DataciteMetadataExtractor(ds, 'elsewhere')._get_dataset_metadata() assert_equal( - dumps(meta, sort_keys=True, indent=2), + json.dumps(meta, sort_keys=True, indent=2), """\ { "author": [ diff --git a/datalad_metalad/extractors/tests/test_custom.py b/datalad_metalad/extractors/tests/test_custom.py index 1a4fad2a..6f2ce518 100644 --- a/datalad_metalad/extractors/tests/test_custom.py +++ b/datalad_metalad/extractors/tests/test_custom.py @@ -8,6 +8,7 @@ # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """Test custom metadata extractor""" +import json from six import text_type from datalad.distribution.dataset import Dataset @@ -19,7 +20,6 @@ known_failure_windows, with_tree, ) -from simplejson import dumps as jsondumps # some metadata to play with, taken from the examples of the google dataset @@ -85,9 +85,9 @@ @with_tree( tree={ '.metadata': { - 'dataset.json': jsondumps(sample_jsonld)}, + 'dataset.json': json.dumps(sample_jsonld)}, 'down': { - 'customloc': jsondumps(testmeta)}}) + 'customloc': json.dumps(testmeta)}}) def test_custom_dsmeta(path=None): ds = Dataset(path).create(force=True) sample_jsonld_ = dict(sample_jsonld)