Commit e883e945 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Fix tests in python2

parent abba1a33
from slapcache.signature import Signature, Config, strategy from slapcache.signature import Signature, Config, strategy
from slapos.libnetworkcache import NetworkcacheClient from slapos.libnetworkcache import NetworkcacheClient
from optparse import Values import slapos.signature, tempfile, unittest, os, sys
import slapos.signature, time, difflib, tempfile, unittest, os
def _fake_call(self, *args, **kw): def _fake_call(self, *args, **kw):
self.last_call = (args, kw) self.last_call = (args, kw)
...@@ -146,7 +145,10 @@ signature-certificate-list = ...@@ -146,7 +145,10 @@ signature-certificate-list =
def test_configuration_file_dont_exist(self): def test_configuration_file_dont_exist(self):
self.config_dict.slapos_configuration = '/abc/123' self.config_dict.slapos_configuration = '/abc/123'
self.assertRaises(FileNotFoundError, Signature, self.config_dict) if sys.version_info.major < 3:
self.assertRaises(IOError, Signature, self.config_dict)
else:
self.assertRaises(FileNotFoundError, Signature, self.config_dict)
def test_download_not_existing(self): def test_download_not_existing(self):
_, path = tempfile.mkstemp() _, path = tempfile.mkstemp()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment