Python: tidied up tests

This commit is contained in:
Gaute Lindkvist 2019-06-06 08:27:39 +02:00
parent 2cbfecd2e6
commit 05451aa904
2 changed files with 5 additions and 2 deletions

View File

@ -26,8 +26,6 @@ class App:
print("Telling ResInsight to Exit")
return self.app.Exit(Empty())
def isConsole(self):
print("RunTimeInfo stuff: ", self.app.GetRuntimeInfo(Empty()).app_type)
return self.app.GetRuntimeInfo(Empty()).app_type == App_pb2.ApplicationTypeEnum.Value('CONSOLE_APPLICATION')
def isGui(self):
print("RunTimeInfo stuff: ", self.app.GetRuntimeInfo(Empty()).app_type)
return self.app.GetRuntimeInfo(Empty()).app_type == App_pb2.ApplicationTypeEnum.Value('GUI_APPLICATION')

View File

@ -8,6 +8,10 @@ import rips
_rips_instance = None
if not os.environ.get("RESINSIGHT_EXECUTABLE"):
print("ERROR: Need to have the environment variable RESINSIGHT_EXECUTABLE set to a valid ResInsight executable")
exit(1)
@pytest.fixture
def rips_instance():
return _rips_instance
@ -26,3 +30,4 @@ def pytest_configure(config):
print("Should run as console app")
console = True
_rips_instance = rips.Instance.launch(console=console)
assert(_rips_instance is not None)