Tests: refactored prerequisites model.

This commit is contained in:
Andrey Zelenkov
2019-09-14 14:44:35 +03:00
parent 962cdb6659
commit 65ca2d7b19
24 changed files with 146 additions and 113 deletions

View File

@@ -4,6 +4,19 @@ from unit.applications.proto import TestApplicationProto
class TestApplicationGo(TestApplicationProto):
@classmethod
def setUpClass(cls, complete_check=True):
unit = super().setUpClass(complete_check=False)
# check go module
go_app = TestApplicationGo()
go_app.testdir = unit.testdir
if go_app.prepare_env('empty', 'app').returncode == 0:
cls.available['modules']['go'] = []
return unit if not complete_check else unit.complete()
def prepare_env(self, script, name):
if not os.path.exists(self.testdir + '/go'):
os.mkdir(self.testdir + '/go')