File tree Expand file tree Collapse file tree 1 file changed +1
-29
lines changed Expand file tree Collapse file tree 1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change 1
1
import datetime
2
2
import os
3
3
import unittest
4
- import tempfile
5
- import odml .terminology
6
- from hashlib import md5
4
+
7
5
try :
8
6
from urllib .request import pathname2url
9
7
except ImportError :
@@ -112,32 +110,6 @@ def test_get_terminology_equivalent(self):
112
110
doc .repository = None
113
111
self .assertIsNone (doc .get_terminology_equivalent ())
114
112
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
-
141
113
def test_append (self ):
142
114
doc = Document ()
143
115
self .assertListEqual (doc .sections , [])
You can’t perform that action at this time.
0 commit comments