Skip to content

Commit

Permalink
test: unskip endpoint tests and inject data #266, #268
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Feb 3, 2022
1 parent 8840a6c commit de26303
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 11 deletions.
254 changes: 246 additions & 8 deletions test/search_api/endpoints/test_get_entity_by_pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,111 @@ class TestSearchAPIGetByPIDEndpoint:
"datasets",
"0-8401-1070-7",
'{"include": [{"relation": "documents"}]}',
{},
{
"pid": "0-8401-1070-7",
"title": "DATASET 2",
"isPublic": True,
"creationDate": "2013-04-01T10:56:52+00:00",
"size": None,
"documents": [
{
"pid": "0-9729806-3-6",
"isPublic": True,
"type": "INVESTIGATIONTYPE 1",
"title": "INVESTIGATION 2",
"summary": "Day purpose item create. Visit hope mean admit."
" The tonight adult cut foreign would situation fund."
"\nPurpose study usually gas think. Machine world doctor"
" rise be college treat.",
"doi": "0-9729806-3-6",
"startDate": "2000-06-04T00:00:00+00:00",
"endDate": "2000-09-14T00:00:00+00:00",
"releaseDate": "2000-02-10T00:00:00+00:00",
"license": None,
"keywords": [
"later868",
"black887",
"yard993",
"as1034",
"sister1072",
"knowledge1239",
"heart1286",
"soon1911",
"television2011",
"turn2206",
"PM2477",
"purpose2641",
"box3225",
"fall3339",
"minute3394",
"family3729",
"industry3903",
"throw4294",
"here4636",
"firm4658",
"same4777",
"travel5029",
"like5061",
"but5204",
"pass5300",
"industry5482",
"they6191",
"company6197",
"bed6368",
"shake6405",
"voice6555",
"above6582",
"former6596",
"body6759",
"price6828",
"star6879",
"clearly7066",
"wall7234",
"ground7790",
"maybe8191",
"population8212",
"indeed8287",
"decide8366",
"agree9237",
"color9257",
"once9593",
"two9737",
"they10312",
"heavy10342",
"decide10450",
"main10579",
"particular10646",
"number11411",
"investment11462",
"interesting11775",
"simple12151",
"stand12178",
"morning12276",
"fish12494",
"story12572",
"art13071",
"once13596",
"music13672",
"film13812",
"level14266",
"claim14304",
"nearly14473",
"eight14566",
"president14766",
"near14993",
],
"datasets": [],
"members": [],
"parameters": [],
},
],
"techniques": [],
"instrument": None,
"files": [],
"parameters": [],
"samples": [],
},
id="Get dataset by pid with include filter",
# TODO - issue with Document.type
marks=pytest.mark.skip,
),
pytest.param(
"documents",
Expand Down Expand Up @@ -306,12 +407,12 @@ class TestSearchAPIGetByPIDEndpoint:
pytest.param(
"datasets",
"0-8401-1070-7",
'{"include": [{"relation": "documents"}, {"relation": "instrument"},'
'{"include": [{"relation": "documents"},'
' {"relation": "files"}, {"relation": "parameters"},'
' {"relation": "samples"}]}',
{},
id="Get dataset by pid including all ICAT 4 related entities",
# TODO - issue with parameters include
# Skipped due to #314 (Sample.pid)
marks=pytest.mark.skip,
),
pytest.param(
Expand All @@ -330,10 +431,147 @@ class TestSearchAPIGetByPIDEndpoint:
"0-449-78690-0",
'{"include": [{"relation": "datasets"}, {"relation": "members"},'
' {"relation": "parameters"}]}',
{},
{
"pid": "0-449-78690-0",
"isPublic": True,
"type": "INVESTIGATIONTYPE 2",
"title": "INVESTIGATION 1",
"summary": "Season identify professor happen third. Beat"
" professional blue clear style have. Light final summer.",
"doi": "0-449-78690-0",
"startDate": "2000-04-03T00:00:00+00:00",
"endDate": "2000-07-09T00:00:00+00:00",
"releaseDate": "2000-07-05T00:00:00+00:00",
"license": None,
"keywords": [
"read123",
"boy129",
"out253",
"hour326",
"possible449",
"west566",
"scene948",
"who1253",
"capital1526",
"dream1989",
"front2347",
"inside2465",
"surface2851",
"learn2953",
"hot3053",
"just3159",
"population3261",
"cup3366",
"another3451",
"environmental3632",
"require3858",
"rock3952",
"determine4048",
"space4061",
"big4229",
"why4243",
"public4362",
"election4641",
"measure4996",
"often5014",
"develop5135",
"than5310",
"floor5312",
"check5327",
"cost5487",
"information6130",
"guy6180",
"admit6235",
"market6645",
"law6777",
"close7336",
"billion7597",
"product7964",
"American8041",
"language8246",
"school8277",
"specific8539",
"position8670",
"grow8702",
"time8899",
"weight9086",
"catch9129",
"speak9559",
"strong9621",
"development9757",
"best9786",
"identify10039",
"give10497",
"life10854",
"century11040",
"fire11580",
"leg11744",
"past11935",
"bar12034",
"do12108",
"prove12224",
"body12251",
"data12288",
"at12640",
"star12706",
"customer12795",
"small13058",
"event13141",
"now13193",
"magazine13415",
"policy13601",
"black13996",
"American14654",
],
"datasets": [
{
"pid": "0-449-78690-0",
"title": "DATASET 1",
"isPublic": True,
"creationDate": "2002-11-27T06:20:36+00:00",
"size": None,
"documents": [],
"techniques": [],
"instrument": None,
"files": [],
"parameters": [],
"samples": [],
},
{
"pid": "0-353-84629-5",
"title": "DATASET 241",
"isPublic": True,
"creationDate": "2006-11-21T17:10:42+00:00",
"size": None,
"documents": [],
"techniques": [],
"instrument": None,
"files": [],
"parameters": [],
"samples": [],
},
],
"members": [
{
"id": "1",
"role": "CI",
"document": None,
"person": None,
"affiliation": None,
},
],
"parameters": [
{
"id": "1",
"name": "PARAMETERTYPE 27",
"value": 127265.0,
"unit": "unit 27",
"dataset": None,
"document": None,
},
],
},
id="Get document by pid including all possible related entities",
# TODO - issue with parameters include
marks=pytest.mark.skip,
),
],
)
Expand Down
Loading

0 comments on commit de26303

Please sign in to comment.