Tests: minor fixes.

Fixed temporary dir removing.
Fixed printing path to log.
Module checks moved to the separate file.
This commit is contained in:
Andrei Zeliankou
2020-10-01 10:17:00 +01:00
parent 1fe1518ab1
commit d491527555
10 changed files with 89 additions and 76 deletions

View File

@@ -6,26 +6,12 @@ from conftest import option
class TestApplicationGo(TestApplicationProto):
@classmethod
def setup_class(cls, complete_check=True):
unit = super().setup_class(complete_check=False)
# check go module
go_app = TestApplicationGo()
go_app.temp_dir = unit.temp_dir
proc = go_app.prepare_env('empty', 'app')
if proc and proc.returncode == 0:
cls.available['modules']['go'] = []
return unit if not complete_check else unit.complete()
def prepare_env(self, script, name, static=False):
if not os.path.exists(self.temp_dir + '/go'):
os.mkdir(self.temp_dir + '/go')
env = os.environ.copy()
env['GOPATH'] = self.pardir + '/build/go'
env['GOPATH'] = option.current_dir + '/build/go'
if static:
args = [