Skip to content

Commit bbd8eb4

Browse files
Reformat expand and to_rdf test literals
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2547e86 commit bbd8eb4

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

tests/test_jsonld.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,20 @@ def test_expand_stringifies_datetime_date_values(self):
546546
"""
547547
from datetime import date
548548

549-
expanded = jsonld.expand({
550-
'@context': {'@vocab': 'https://schema.org/'},
551-
'@id': 'https://example.blog/post',
552-
'publicationDate': date(2021, 1, 11),
553-
})
549+
expanded = jsonld.expand(
550+
{
551+
'@context': {'@vocab': 'https://schema.org/'},
552+
'@id': 'https://example.blog/post',
553+
'publicationDate': date(2021, 1, 11),
554+
}
555+
)
554556

555-
assert expanded == [{
556-
'@id': 'https://example.blog/post',
557-
'https://schema.org/publicationDate': [{'@value': '2021-01-11'}],
558-
}]
557+
assert expanded == [
558+
{
559+
'@id': 'https://example.blog/post',
560+
'https://schema.org/publicationDate': [{'@value': '2021-01-11'}],
561+
}
562+
]
559563

560564
# Issue 167
561565
def test_blank_node_prefixes(self):
@@ -1111,9 +1115,11 @@ def test_fractional(self):
11111115
"""
11121116
Number with 0 fractional part should parse to an xsd:integer
11131117
"""
1114-
input = { "ex:value": 42.0 }
1118+
input = {"ex:value": 42.0}
11151119

1116-
expected = '_:b0 <ex:value> "42"^^<http://www.w3.org/2001/XMLSchema#integer> .\n'
1120+
expected = (
1121+
'_:b0 <ex:value> "42"^^<http://www.w3.org/2001/XMLSchema#integer> .\n'
1122+
)
11171123

11181124
nquads = jsonld.to_rdf(input, options={'format': 'application/n-quads'})
11191125
assert nquads == expected
@@ -1123,13 +1129,16 @@ def test_truncate_zeros_with_negative_exponent_numbers(self):
11231129
"""
11241130
Numeric values with negative exponent should truncate zeros
11251131
"""
1126-
input = { "ex:value": 0.97 }
1132+
input = {"ex:value": 0.97}
11271133

1128-
expected = '_:b0 <ex:value> "9.7E-1"^^<http://www.w3.org/2001/XMLSchema#double> .\n'
1134+
expected = (
1135+
'_:b0 <ex:value> "9.7E-1"^^<http://www.w3.org/2001/XMLSchema#double> .\n'
1136+
)
11291137

11301138
nquads = jsonld.to_rdf(input, options={'format': 'application/n-quads'})
11311139
assert nquads == expected
11321140

1141+
11331142
class TestFromRDF:
11341143
def test_compound_literal_direction_without_language(self):
11351144
"""

0 commit comments

Comments
 (0)