2323
2424BASE_URL = "https://metadata-portal.allenneuraldynamics.org"
2525PROJECT = f"integration-test-lifecycle-{ int (time .time ())} "
26+ DOI = f"10.1234/integration-test-{ int (time .time ())} "
2627PASSWORD = "sha256-integration-test-hash"
2728GET_URL = f"{ BASE_URL } /contributions/get"
2829POST_URL = f"{ BASE_URL } /contributions/post"
@@ -99,7 +100,7 @@ def check(response, expected_status):
99100
100101V2 = {
101102 "project_name" : PROJECT ,
102- "doi" : "10.1234/integration-test" ,
103+ "doi" : DOI ,
103104 "contributors" : [
104105 {
105106 "author" : {
@@ -146,7 +147,7 @@ def check(response, expected_status):
146147data = check (r , 200 )
147148names = [c ["author" ]["name" ] for c in data ["contributors" ]]
148149assert len (names ) == 2 , f"expected 2 contributors, got { names } "
149- assert data .get ("doi" ) == "10.1234/integration-test"
150+ assert data .get ("doi" ) == DOI
150151assert data .get ("locked" ) is True , f"expected locked=True, got { data .get ('locked' )} "
151152print (f" contributors: { names } " )
152153print (f" doi: { data .get ('doi' )} " )
@@ -170,7 +171,7 @@ def check(response, expected_status):
170171
171172V3 = {
172173 "project_name" : PROJECT ,
173- "doi" : "10.1234/integration-test" ,
174+ "doi" : DOI ,
174175 "contributors" : [
175176 {
176177 "author" : {
@@ -243,7 +244,7 @@ def check(response, expected_status):
243244sep ("Step 8: GET token without password on locked project (expect 401)" )
244245r = requests .get (
245246 TOKEN_URL ,
246- params = {"doi" : "10.1234/integration-test" , "type" : "add_author" },
247+ params = {"doi" : DOI , "type" : "add_author" },
247248)
248249check (r , 401 )
249250
@@ -255,7 +256,7 @@ def check(response, expected_status):
255256r = requests .get (
256257 TOKEN_URL ,
257258 params = {
258- "doi" : "10.1234/integration-test" ,
259+ "doi" : DOI ,
259260 "type" : "add_author" ,
260261 "password" : PASSWORD ,
261262 },
@@ -275,7 +276,7 @@ def check(response, expected_status):
275276
276277V4 = {
277278 "project_name" : PROJECT ,
278- "doi" : "10.1234/integration-test" ,
279+ "doi" : DOI ,
279280 "contributors" : [
280281 {
281282 "author" : {
@@ -368,7 +369,7 @@ def check(response, expected_status):
368369r = requests .get (
369370 TOKEN_URL ,
370371 params = {
371- "doi" : "10.1234/integration-test" ,
372+ "doi" : DOI ,
372373 "type" : "edit_author" ,
373374 "password" : PASSWORD ,
374375 },
@@ -383,7 +384,7 @@ def check(response, expected_status):
383384r = requests .get (
384385 TOKEN_URL ,
385386 params = {
386- "doi" : "10.1234/integration-test" ,
387+ "doi" : DOI ,
387388 "type" : "edit_author" ,
388389 "author" : "Carmen Silva" ,
389390 "days" : "30" ,
@@ -405,7 +406,7 @@ def check(response, expected_status):
405406
406407V5 = {
407408 "project_name" : PROJECT ,
408- "doi" : "10.1234/integration-test" ,
409+ "doi" : DOI ,
409410 "contributors" : [
410411 {
411412 "author" : {
0 commit comments