# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2017 CEA/DEN, EDF R&D
+# Copyright (C) 2017-2021 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Author : Anthony Geay (EDF R&D)
from medcoupling import *
+
import unittest
+def WriteInTmpDir(func):
+ def decoratedFunc(*args,**kwargs):
+ import tempfile,os
+ ret = None
+ with tempfile.TemporaryDirectory() as tmpdirname:
+ os.chdir(tmpdirname)
+ ret = func(*args,**kwargs)
+ pass
+ return ret
+ return decoratedFunc
+
class FileCreator(object):
def __init__(self,tester,fname):
self._tester=tester
pass
@unittest.skipUnless(HasMEDFileExt(),"Requires link to MED file")
+ @WriteInTmpDir
def test1(self):
import sys
fname="mctest1.med"