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