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
Empty file added tests/extractors/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion tests/extractors/test_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
74 changes: 74 additions & 0 deletions tests/extractors/test_categories/categories_df_out.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/extractors/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
67 changes: 67 additions & 0 deletions tests/extractors/test_tags/tags_df_out.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Binary file removed tests/extractors/test_tags/tags_df_out.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/extractors/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
49 changes: 49 additions & 0 deletions tests/extractors/test_users/users_df_out.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Binary file removed tests/extractors/test_users/users_df_out.pickle
Binary file not shown.