diff options
author | 2011-09-23 23:03:26 -0700 | |
---|---|---|
committer | 2011-09-23 23:03:26 -0700 | |
commit | 25ae8b28da0632ed33935e32071c9aa683814da2 (patch) | |
tree | e533ddec419bcbd808a4560ef0403f5908415026 /layman/api.py | |
parent | py2, py3 compatability changes so 2to3 will work correctly. (diff) | |
download | layman-25ae8b28da0632ed33935e32071c9aa683814da2.tar.gz layman-25ae8b28da0632ed33935e32071c9aa683814da2.tar.bz2 layman-25ae8b28da0632ed33935e32071c9aa683814da2.zip |
make the tests more py3 compatibile.
Diffstat (limited to 'layman/api.py')
-rwxr-xr-x | layman/api.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/layman/api.py b/layman/api.py index c1a0e97..3005c3f 100755 --- a/layman/api.py +++ b/layman/api.py @@ -396,7 +396,9 @@ class LaymanAPI(object): >>> import os >>> here = os.path.dirname(os.path.realpath(__file__)) - >>> cache = os.tmpnam() + >>> import tempfile + >>> tmpdir = tempfile.mkdtemp(prefix="laymantmp_") + >>> cache = os.path.join(tmpdir, 'cache') >>> from layman.config import OptionConfig >>> opts = {'overlays' : ... ['file://' + here + '/tests/testfiles/global-overlays.xml'], @@ -440,6 +442,8 @@ class LaymanAPI(object): #'priority': 10, 'feeds': [], 'irc': None, 'homepage': None}} >>> os.unlink(filename) + >>> import shutil + >>> shutil.rmtree(tmpdir) """ try: |