Skip to content

Commit afe6514

Browse files
authored
Merge pull request #297 from KnowledgeCaptureAndDiscovery/dev
Dev
2 parents c355201 + 3dd17c1 commit afe6514

File tree

1 file changed

+29
-33
lines changed

1 file changed

+29
-33
lines changed

src/somef/test/test_cli.py

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ class TestCli(unittest.TestCase):
77

88
def test_extract_bibtex(self):
99
test_txt = """
10-
Author: Daniel Garijo Verdejo (@dgarijo)
11-
Contributors: María Poveda, Idafen Santana, Almudena Ruiz, Miguel Angel García, Oscar Corcho, Daniel Vila, Sergio Barrio, Martin Scharm, Maxime Lefrancois, Alfredo Serafini, @kartgk.
12-
Citing WIDOCO: If you used WIDOCO in your work, please cite the ISWC 2017 paper: https://iswc2017.semanticweb.org/paper-138
13-
bib
14-
@inproceedings{garijo2017widoco,
15-
title={WIDOCO: a wizard for documenting ontologies},
16-
author={Garijo, Daniel},
17-
booktitle={International Semantic Web Conference},
18-
pages={94--102},
19-
year={2017},
20-
organization={Springer, Cham},
21-
doi = {10.1007/978-3-319-68204-4_9},
22-
funding = {USNSF ICER-1541029, NIH 1R01GM117097-01},
23-
url={http://dgarijo.com/papers/widoco-iswc2017.pdf}
24-
}
25-
If you want to cite the latest version of the software, you can do so by using: https://zenodo.org/badge/latestdoi/11427075.
10+
**Citing WIDOCO**: If you used WIDOCO in your work, please cite the ISWC 2017 paper: https://iswc2017.semanticweb.org/paper-138
11+
12+
```bib
13+
@inproceedings{garijo2017widoco,
14+
title={WIDOCO: a wizard for documenting ontologies},
15+
author={Garijo, Daniel},
16+
booktitle={International Semantic Web Conference},
17+
pages={94--102},
18+
year={2017},
19+
organization={Springer, Cham},
20+
doi = {10.1007/978-3-319-68204-4_9},
21+
funding = {USNSF ICER-1541029, NIH 1R01GM117097-01},
22+
url={http://dgarijo.com/papers/widoco-iswc2017.pdf}
23+
}
24+
```
25+
If you want to cite the latest version of the software, you can do so by using: https://zenodo.org/badge/latestdoi/11427075.
2626
"""
2727
c = extract_bibtex(test_txt)
2828
# Only one element is returned.
@@ -54,12 +54,12 @@ def test_extract_binder_links(self):
5454

5555
def test_extract_title_underline(self):
5656
test_text = """
57-
Taguette
58-
========
59-
Some text goes here
60-
61-
Other header
62-
------------
57+
Taguette
58+
========
59+
Some text goes here
60+
61+
Other header
62+
------------
6363
"""
6464
c = extract_title(test_text)
6565
assert "Taguette" == c
@@ -190,7 +190,7 @@ def test_issue_211(self):
190190
header = {}
191191
header['accept'] = 'application/vnd.github.v3+json'
192192
text, github_data = load_repository_metadata("https://github.com/probot/probot/tree/v12.1.1", header)
193-
assert len(github_data['contributingGuidelines']) > 0 and len(github_data['licenseFile']) > 0
193+
assert len(github_data['contributingGuidelines']) > 0 and len(github_data['license']) > 0
194194

195195
def test_issue_218(self):
196196
header = {}
@@ -202,11 +202,12 @@ def test_issue_224(self):
202202
repo_data = cli_get_data(0.8, False, repo_url="https://github.com/tensorflow/tensorflow/tree/v2.6.0")
203203
data_graph = DataGraph()
204204
data_graph.add_somef_data(repo_data)
205-
output = io.StringIO()
206-
print(data_graph, file=output)
207-
content = output.getvalue()
208-
output.close()
209-
assert content.find("sd:dateCreated") >= 0
205+
with open("test-tensorflow-2.6.0.ttl", "wb") as out_file:
206+
out_file.write(data_graph.g.serialize(format="turtle", encoding="UTF-8"))
207+
text_file = open("test-tensorflow-2.6.0.ttl", "r", encoding="UTF-8")
208+
data = text_file.read()
209+
text_file.close()
210+
assert data.find("sd:dateCreated") >= 0
210211

211212
def test_issue_280(self):
212213
with open("input-test.txt", "r") as in_handle:
@@ -247,11 +248,6 @@ def test_issu_210(self):
247248
pretty=True,
248249
missing=False)
249250
text_file = open("test-tensorflow-2.6.0.json-ld", "r")
250-
251-
# read whole file to a string
252251
data = text_file.read()
253-
254-
# close file
255252
text_file.close()
256-
257253
assert data.find("\"acknowledgments\":") >= 0

0 commit comments

Comments
 (0)