Commit 152c075b authored by Jérome Perrin's avatar Jérome Perrin

tests: skip some tests on python2

These are only supposed to be used in python3 software releases.
parent a721147c
......@@ -25,14 +25,19 @@
#
##############################################################################
import os
from datetime import datetime
from datetime import timedelta
import os
import unittest
import six
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_baseband_latency import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckBasebandLatency(TestPromisePluginMixin):
promise_name = "check-baseband-latency.py"
......
......@@ -27,11 +27,16 @@
import mock
import time
import unittest
import six
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_cpu_temperature import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckCpuTemperature(TestPromisePluginMixin):
promise_name = "monitor-cpu-temperature.py"
......
......@@ -25,12 +25,16 @@
#
##############################################################################
from slapos.test.promise.plugin import TestPromisePluginMixin
from slapos.grid.promise import PromiseError
import os
import sqlite3
import unittest
import six
from slapos.test.promise.plugin import TestPromisePluginMixin
from slapos.grid.promise import PromiseError
class TestCheckFreeDiskSpace(TestPromisePluginMixin):
def setUp(self):
......@@ -130,6 +134,7 @@ extra_config_dict = {
"The partition slappart1 uses 20.87 G (date checked: 2017-10-02 09:17:00)."
self.assertIn(message, result['result']['message'])
@unittest.skipIf(six.PY2, 'Python3 only')
def test_display_prediction(self):
content = """from slapos.promise.plugin.check_free_disk_space import RunPromise
......
......@@ -25,15 +25,20 @@
#
##############################################################################
import os
import time
from datetime import datetime
from datetime import timedelta
import os
import time
import unittest
import six
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_lopcomm_lof import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckLopcommLOFSuccess(TestPromisePluginMixin):
promise_name = "check-lopcomm-lof.py"
......
......@@ -25,15 +25,20 @@
#
##############################################################################
import os
import time
from datetime import datetime
from datetime import timedelta
import os
import time
import unittest
import six
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_lopcomm_rssi import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckLopcommRSSISuccess(TestPromisePluginMixin):
promise_name = "check-lopcomm-rssi.py"
......
......@@ -25,15 +25,20 @@
#
##############################################################################
import os
import time
from datetime import datetime
from datetime import timedelta
import os
import time
import unittest
import six
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_lopcomm_vswr import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckLopcommVSWRSuccess(TestPromisePluginMixin):
promise_name = "check-lopcomm-vswr.py"
......
......@@ -25,16 +25,20 @@
#
##############################################################################
import mock
from collections import namedtuple
import os
import time
import unittest
import mock
import six
from collections import namedtuple
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_network_transit import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckNetworkTransit(TestPromisePluginMixin):
promise_name = "monitor-network-transit.py"
......
......@@ -25,16 +25,20 @@
#
##############################################################################
import mock
from collections import namedtuple
import os
import time
import unittest
import mock
import six
from collections import namedtuple
from slapos.grid.promise import PromiseError
from slapos.promise.plugin.check_ram_usage import RunPromise
from . import TestPromisePluginMixin
@unittest.skipIf(six.PY2, 'Python3 only')
class TestCheckRamUsage(TestPromisePluginMixin):
promise_name = "monitor-ram-usage.py"
......
......@@ -7,8 +7,11 @@ import os
import shutil
import tempfile
import time
import unittest
import six
@unittest.skipIf(six.PY2, "Python 3 only")
class CheckSurykatkaJSONMixin(TestPromisePluginMixin):
maxDiff = None # show full diffs for test readability
promise_name = 'check-surykatka-json.py'
......@@ -63,6 +66,7 @@ class CheckSurykatkaJSONMixin(TestPromisePluginMixin):
message)
@unittest.skipIf(six.PY2, "Python 3 only")
class TestCheckSurykatkaJSONBase(CheckSurykatkaJSONMixin):
def test_no_config(self):
self.writeSurykatkaPromise()
......@@ -108,6 +112,7 @@ class TestCheckSurykatkaJSONBase(CheckSurykatkaJSONMixin):
"ERROR Report 'NOT_EXISTING_ENTRY' is not supported")
@unittest.skipIf(six.PY2, "Python 3 only")
class TestCheckSurykatkaJSONBotStatus(CheckSurykatkaJSONMixin):
def test(self):
self.writeSurykatkaPromise(
......@@ -220,6 +225,7 @@ class TestCheckSurykatkaJSONBotStatus(CheckSurykatkaJSONMixin):
"bot_status: ERROR 'bot_status' empty in '%s'" % (self.json_file,))
@unittest.skipIf(six.PY2, "Python 3 only")
class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
def setUp(self):
super().setUp()
......
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