OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
FixturePythonWrapper.h
Go to the documentation of this file.
1#pragma once
2#include "PythonWrapper.h"
3#include <gtest/gtest.h>
4#include <list>
5
6class FixturePythonWrapper : public testing::Test
7{
8public:
10
11 std::string getMainModulName() const { return _mainModuleName; }
12
13 void ExecuteString(const std::string& command, const std::string& moduleName);
14 std::string ExecuteFunctionWithReturnValue(const std::string& functionName, const std::string& moduleName);
15 int ExecuteFunctionWithParameter(const std::string& functionName, int parameter, const std::string& moduleName);
16 int ExecuteFunctionWithMultipleParameter(const std::string& functionName, int parameter1, int parameter2, std::string parameter3, const std::string& moduleName);
17 int32_t GetGlobalVariable(const std::string& varName, const std::string& moduleName);
18 std::list<std::string> GetPathVariable(const std::string& moduleName);
19 void AddNumpyToPath();
20 void ResetPythonPath();
21
22private:
23 PythonWrapper _wrapper;
24 std::string _mainModuleName = "__main__";
25};
Wrapper around python code execution.
Definition FixturePythonWrapper.h:7
std::list< std::string > GetPathVariable(const std::string &moduleName)
Definition FixturePythonWrapper.cpp:62
FixturePythonWrapper()
Definition FixturePythonWrapper.cpp:6
int ExecuteFunctionWithParameter(const std::string &functionName, int parameter, const std::string &moduleName)
Definition FixturePythonWrapper.cpp:25
void ExecuteString(const std::string &command, const std::string &moduleName)
Definition FixturePythonWrapper.cpp:12
int ExecuteFunctionWithMultipleParameter(const std::string &functionName, int parameter1, int parameter2, std::string parameter3, const std::string &moduleName)
Definition FixturePythonWrapper.cpp:37
void AddNumpyToPath()
Definition FixturePythonWrapper.cpp:69
std::string getMainModulName() const
Definition FixturePythonWrapper.h:11
void ResetPythonPath()
Definition FixturePythonWrapper.cpp:74
int32_t GetGlobalVariable(const std::string &varName, const std::string &moduleName)
Definition FixturePythonWrapper.cpp:55
std::string ExecuteFunctionWithReturnValue(const std::string &functionName, const std::string &moduleName)
Definition FixturePythonWrapper.cpp:17
Definition PythonWrapper.h:19