Skip to content

Commit

Permalink
Test fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
spikelynch committed Dec 9, 2024
1 parent f35b13b commit f3c1d5f
Show file tree
Hide file tree
Showing 7 changed files with 18,163 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest


@pytest.fixture
def crates():
return {
"minimal": "./tests/crates/minimal",
"wide": "./tests/crates/wide",
"textfiles": "./tests/crates/textfiles",
}
37 changes: 37 additions & 0 deletions tests/crates/minimal/ro-crate-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"@context": "https://w3id.org/ro/crate/1.1/context",
"@graph":
[
{
"@type": "CreativeWork",
"@id": "ro-crate-metadata.json",
"conformsTo":
{
"@id": "https://w3id.org/ro/crate/1.1"
},
"about":
{
"@id": "./"
}
},
{
"@id": "./",
"identifier": "https://doi.org/10.4225/59/59672c09f4a4b",
"@type": "Dataset",
"datePublished": "2017",
"name": "Minimal crate",
"description": "A mininal RO-Crate",
"license":
{
"@id": "https://creativecommons.org/licenses/by-nc-sa/3.0/au/"
}
},
{
"@id": "https://creativecommons.org/licenses/by-nc-sa/3.0/au/",
"@type": "CreativeWork",
"description": "This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/au/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.",
"identifier": "https://creativecommons.org/licenses/by-nc-sa/3.0/au/",
"name": "Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0 AU)"
}
]
}
1 change: 1 addition & 0 deletions tests/crates/textfiles/doc001/somethingelse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This should not be indexed into the database
1 change: 1 addition & 0 deletions tests/crates/textfiles/doc001/textfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
7 changes: 7 additions & 0 deletions tests/crates/textfiles/doc002/utterances.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Speaker,Date,Utterance
Fred,1/1/2001,Hey
Jo,2/3/2002,How you doing
Carol,3/12/2003,Sorry you can't get through
Bob,21/3/2004,why don't you leave your name
Ted,1/5/2005,And your number
Alice,6/12/2006,And I'll get back to you
74 changes: 74 additions & 0 deletions tests/crates/textfiles/ro-crate-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"@context": "https://w3id.org/ro/crate/1.1/context",
"@graph":
[
{
"@type": "CreativeWork",
"@id": "ro-crate-metadata.json",
"conformsTo":
{
"@id": "https://w3id.org/ro/crate/1.1"
},
"about":
{
"@id": "./"
}
},
{
"@id": "./",
"identifier": "https://doi.org/10.4225/59/59672c09f4a4b",
"@type": "Dataset",
"datePublished": "2017",
"name": "Minimal crate",
"description": "An RO-Crate with a text file",
"license":
{
"@id": "https://creativecommons.org/licenses/by-nc-sa/3.0/au/"
},
"hasPart": [
{ "@id": "doc001" },
{ "@id": "doc002" }
]
},
{
"@id": "doc001",
"@type": "Dataset",
"name": "A text file for testing",
"indexableText": { "@id": "doc001/textfile.txt" },
"hasPart": [
{ "@id": "doc001/textfile.txt" },
{ "@id": "doc001/somethingelse.txt" }
]
},
{ "@id": "doc001/textfile.txt",
"@type": "File",
"name": "text file",
"contentEncoding": "text/plain"
},
{ "@id": "doc001/somethingelse.txt",
"@type": "File",
"name": "text file",
"contentEncoding": "text/plain"
},
{
"@id": "doc002",
"@type": "Dataset",
"name": "A csv file for testing",
"hasPart": [
{ "@id": "doc002/utterances.csv" }
]
},
{ "@id": "doc002/utterances.csv",
"@type": "File",
"name": "CSV file",
"contentEncoding": "text/csv"
},
{
"@id": "https://creativecommons.org/licenses/by-nc-sa/3.0/au/",
"@type": "CreativeWork",
"description": "This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/au/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.",
"identifier": "https://creativecommons.org/licenses/by-nc-sa/3.0/au/",
"name": "Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0 AU)"
}
]
}
Loading

0 comments on commit f3c1d5f

Please sign in to comment.