Skip to content

Commit

Permalink
lint fixes to test_scidata.py
Browse files Browse the repository at this point in the history
  • Loading branch information
stuchalk committed Apr 11, 2021
1 parent 60a74a7 commit 6f38610
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tests/test_scidata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""pytest test class for scidata.py"""
from scidatalib.scidata import SciData
from datetime import *
from datetime import datetime

sd = SciData('example')

Expand Down Expand Up @@ -205,9 +205,10 @@ def test_datagroup():
'qudt': 'http://qudt.org/vocab/unit/'
}
)
val1 = {'@id': 'numericvalue', 'number': 0.99913, 'unitref': 'qudt:GM-PER-MilliL'}
val2 = {'@id': 'numericvalue', 'number': 0.99823, 'unitref': 'qudt:GM-PER-MilliL'}
val3 = {'@id': 'numericvalue', 'number': 0.99707, 'unitref': 'qudt:GM-PER-MilliL'}
atid = 'numericvalue'
val1 = {'@id': atid, 'number': 0.99913, 'unitref': 'qudt:GM-PER-MilliL'}
val2 = {'@id': atid, 'number': 0.99823, 'unitref': 'qudt:GM-PER-MilliL'}
val3 = {'@id': atid, 'number': 0.99707, 'unitref': 'qudt:GM-PER-MilliL'}
pnt1 = {
'@id': 'datapoint',
'quantity': 'gb:D01590',
Expand All @@ -231,7 +232,8 @@ def test_datagroup():
'source': 'chemicalsystem/1/',
'datapoints': [pnt1, pnt2, pnt3]
}
# datapoint indexes start at 2 because of the datapoint added in the datapoint test above
# datapoint indexes start at 2 because of the
# datapoint added in the datapoint test above
out = {
"@id": "datagroup/1/",
"@type": "sdo:datagroup",
Expand All @@ -246,16 +248,19 @@ def test_datagroup():


def test_source():
cite = 'The Meaning of Liff, Douglas Adams and John Lloyd, ISBN 0-330-28121-6, 1983'
cite = 'The Meaning of Liff, Douglas Adams and John Lloyd, ' \
'ISBN 0-330-28121-6, 1983'
url = 'https://en.wikipedia.org/wiki/The_Meaning_of_Liff'
src = [{'citation': cite, 'url': url}]
out = [{"@id": "source/1/", "@type": "dc:source", "citation": cite, "url": url}]
out = [{"@id": "source/1/", "@type": "dc:source",
"citation": cite, "url": url}]
assert sd.sources(src) == out


def test_rights():
holder = 'Megadodo Productions'
licurl = 'https://creativecommons.org/licenses/by/4.0/'
lic = 'Creative Commons, Attribution 4.0 Galactic (CC BY 4.0) ' + licurl
out = [{"@id": "rights/1/", "@type": "dc:rights", "holder": holder, "license": lic}]
out = [{"@id": "rights/1/", "@type": "dc:rights",
"holder": holder, "license": lic}]
assert sd.rights(holder, lic) == out

0 comments on commit 6f38610

Please sign in to comment.