Skip to content

Commit fa8436a

Browse files
committed
[test/doc] Remove terminology.refresh test
The terminology test was removed since - the test should not depend on an offsite repository. - should be in its own file 'test_terminology'.
1 parent dc5726f commit fa8436a

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

test/test_doc.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import datetime
22
import os
33
import unittest
4-
import tempfile
5-
import odml.terminology
6-
from hashlib import md5
4+
75
try:
86
from urllib.request import pathname2url
97
except ImportError:
@@ -112,32 +110,6 @@ def test_get_terminology_equivalent(self):
112110
doc.repository = None
113111
self.assertIsNone(doc.get_terminology_equivalent())
114112

115-
def test_terminology_refresh(self):
116-
117-
cache_dir = os.path.join(tempfile.gettempdir(), "odml.cache")
118-
url = "https://terminologies.g-node.org/v1.1/terminologies.xml"
119-
term_doc = odml.terminology.load(url)
120-
121-
terms = []
122-
for sec in term_doc.sections:
123-
terms += ['.'.join([md5(sec.include.encode()).hexdigest(), os.path.basename(sec.include)])]
124-
125-
before = datetime.datetime.now()
126-
127-
for loaded_file in os.listdir(cache_dir):
128-
for term in terms:
129-
if term in loaded_file:
130-
assert datetime.datetime.fromtimestamp(
131-
os.path.getmtime(os.path.join(cache_dir, loaded_file))) < before
132-
133-
odml.terminology.refresh(url)
134-
135-
for replaced_file in os.listdir(cache_dir):
136-
for term in terms:
137-
if term in replaced_file:
138-
assert datetime.datetime.fromtimestamp(
139-
os.path.getmtime(os.path.join(cache_dir, replaced_file))) > before
140-
141113
def test_append(self):
142114
doc = Document()
143115
self.assertListEqual(doc.sections, [])

0 commit comments

Comments
 (0)