diff --git a/tests/extractors/__init__.py b/tests/extractors/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/extractors/test_categories.py b/tests/extractors/test_categories.py index 4ae0a12..13f7f26 100644 --- a/tests/extractors/test_categories.py +++ b/tests/extractors/test_categories.py @@ -19,7 +19,7 @@ def categories_df(categories_df_and_registry): def test_equals_expected(datadir, categories_df): - expected_df = pd.read_pickle(datadir / "categories_df_out.pickle") + expected_df = pd.read_json(datadir / "categories_df_out.json", orient="table") assert categories_df.equals(expected_df) diff --git a/tests/extractors/test_categories/categories_df_out.json b/tests/extractors/test_categories/categories_df_out.json new file mode 100644 index 0000000..91342c2 --- /dev/null +++ b/tests/extractors/test_categories/categories_df_out.json @@ -0,0 +1,74 @@ +{ + "schema":{ + "fields":[ + { + "name":"id", + "type":"integer" + }, + { + "name":"count", + "type":"integer" + }, + { + "name":"description", + "type":"string" + }, + { + "name":"link", + "type":"string" + }, + { + "name":"name", + "type":"string" + }, + { + "name":"slug", + "type":"string" + }, + { + "name":"parent", + "type":"number" + }, + { + "name":"link_locale", + "type":"string" + } + ], + "primaryKey":[ + "id" + ], + "pandas_version":"1.4.0" + }, + "data":[ + { + "id":1, + "count":3, + "description":"About Test Category One", + "link":"https:\/\/example.org\/test-category-one\/", + "name":"Test Category One", + "slug":"test-category-one", + "parent":null, + "link_locale":null + }, + { + "id":2, + "count":3, + "description":"About Test Category Two", + "link":"https:\/\/example.org\/fr\/test-category-two\/", + "name":"Test Category Two", + "slug":"test-category-two", + "parent":null, + "link_locale":"fr" + }, + { + "id":3, + "count":3, + "description":"About Test Category Three", + "link":"https:\/\/example.org\/fr\/test-category-three\/", + "name":"Test Category Three", + "slug":"test-category-three", + "parent":2.0, + "link_locale":"fr" + } + ] +} \ No newline at end of file diff --git a/tests/extractors/test_categories/categories_df_out.pickle b/tests/extractors/test_categories/categories_df_out.pickle deleted file mode 100644 index ad87721..0000000 Binary files a/tests/extractors/test_categories/categories_df_out.pickle and /dev/null differ diff --git a/tests/extractors/test_tags.py b/tests/extractors/test_tags.py index a9ede29..04a29ae 100644 --- a/tests/extractors/test_tags.py +++ b/tests/extractors/test_tags.py @@ -18,7 +18,7 @@ def tags_df(tags_df_and_registry): def test_equals_expected(datadir, tags_df): - expected_df = pd.read_pickle(datadir / "tags_df_out.pickle") + expected_df = pd.read_json(datadir / "tags_df_out.json", orient="table") assert tags_df.equals(expected_df) diff --git a/tests/extractors/test_tags/tags_df_out.json b/tests/extractors/test_tags/tags_df_out.json new file mode 100644 index 0000000..56b4e4d --- /dev/null +++ b/tests/extractors/test_tags/tags_df_out.json @@ -0,0 +1,67 @@ +{ + "schema":{ + "fields":[ + { + "name":"id", + "type":"integer" + }, + { + "name":"count", + "type":"integer" + }, + { + "name":"description", + "type":"string" + }, + { + "name":"link", + "type":"string" + }, + { + "name":"name", + "type":"string" + }, + { + "name":"slug", + "type":"string" + }, + { + "name":"link_locale", + "type":"string" + } + ], + "primaryKey":[ + "id" + ], + "pandas_version":"1.4.0" + }, + "data":[ + { + "id":1, + "count":3, + "description":"About Test Tag One", + "link":"https:\/\/example.org\/tag\/test-tag-one\/", + "name":"Test Tag One", + "slug":"test-tag-one", + "link_locale":null + }, + { + "id":2, + "count":3, + "description":"About Test Tag Two", + "link":"https:\/\/example.org\/fr\/test-tag-two\/", + "name":"Test Tag Two", + "slug":"test-tag-two", + "link_locale":"fr" + }, + { + "id":3, + "count":3, + "description":"About Test Tag Three", + "link":"https:\/\/example.org\/fr\/tag\/test-tag-three\/", + "name":"Test Tag Three", + "slug":"test-tag-three", + "link_locale":"fr" + } + ] +} \ No newline at end of file diff --git a/tests/extractors/test_tags/tags_df_out.pickle b/tests/extractors/test_tags/tags_df_out.pickle deleted file mode 100644 index 75f252a..0000000 Binary files a/tests/extractors/test_tags/tags_df_out.pickle and /dev/null differ diff --git a/tests/extractors/test_users.py b/tests/extractors/test_users.py index 6fffde8..9d219ba 100644 --- a/tests/extractors/test_users.py +++ b/tests/extractors/test_users.py @@ -9,5 +9,5 @@ def users_df(datadir): def test_user_load(datadir, users_df): - expected_df = pd.read_pickle(datadir / "users_df_out.pickle") + expected_df = pd.read_json(datadir / "users_df_out.json", orient="table") assert users_df.equals(expected_df) diff --git a/tests/extractors/test_users/users_df_out.json b/tests/extractors/test_users/users_df_out.json new file mode 100644 index 0000000..0dc4de3 --- /dev/null +++ b/tests/extractors/test_users/users_df_out.json @@ -0,0 +1,49 @@ +{ + "schema":{ + "fields":[ + { + "name":"id", + "type":"integer" + }, + { + "name":"name", + "type":"string" + }, + { + "name":"url", + "type":"string" + }, + { + "name":"description", + "type":"string" + }, + { + "name":"link", + "type":"string" + }, + { + "name":"slug", + "type":"string" + }, + { + "name":"avatar", + "type":"string" + } + ], + "primaryKey":[ + "id" + ], + "pandas_version":"1.4.0" + }, + "data":[ + { + "id":1, + "name":"Author1", + "url":"https:\/\/author1.gate.ac.uk", + "description":"An author", + "link":"https:\/\/example.org\/author\/author1\/", + "slug":"author1", + "avatar":"https:\/\/secure.gravatar.com\/avatar\/f72c502e0d657f363b5f2dc79dd8ceea?s=500&d=mm&r=g" + } + ] +} \ No newline at end of file diff --git a/tests/extractors/test_users/users_df_out.pickle b/tests/extractors/test_users/users_df_out.pickle deleted file mode 100644 index ae37bb0..0000000 Binary files a/tests/extractors/test_users/users_df_out.pickle and /dev/null differ