|
### Structure of TestCodeFlow |
|
|
|
``` |
|
code |
|
| |
|
v |
|
+-------------------+ |
|
| TestCodeFileEdit | Edit a temp code file with the code to be tested and necessary imports (manually added): https://huggingface.co/Tachi67/TestCodeFlowModule/blob/main/TestCodeFileEditAtomicFlow.py |
|
+-------------------+ |
|
| |
|
| (temp_code_file_location) |
|
| |
|
v |
|
+------------------+ |
|
| CodeTesting | Opens up the temp file until user closes the file, run the test code. |
|
+------------------+ |
|
| |
|
| (feedback) |
|
| |
|
v |
|
feedback |
|
|
|
|
|
``` |
|
Memory_files: |
|
- library.py |
|
|
|
# Table of Contents |
|
|
|
* [TestCodeFlow](#TestCodeFlow) |
|
* [TestCodeFlow](#TestCodeFlow.TestCodeFlow) |
|
* [TestCodeFileEditAtomicFlow](#TestCodeFileEditAtomicFlow) |
|
* [TestCodeFileEditAtomicFlow](#TestCodeFileEditAtomicFlow.TestCodeFileEditAtomicFlow) |
|
* [\_\_init\_\_](#__init__) |
|
* [CodeTestingAtomicFlow](#CodeTestingAtomicFlow) |
|
* [CodeTestingAtomicFlow](#CodeTestingAtomicFlow.CodeTestingAtomicFlow) |
|
|
|
<a id="TestCodeFlow"></a> |
|
|
|
# TestCodeFlow |
|
|
|
<a id="TestCodeFlow.TestCodeFlow"></a> |
|
|
|
## TestCodeFlow Objects |
|
|
|
```python |
|
class TestCodeFlow(SequentialFlow) |
|
``` |
|
|
|
This class is used to test code. It is a sequential flow that runs the following steps: |
|
1. Prepares the code to be tested, it is composed of the code to be tested and necessary import statements manually added. |
|
2. Opens the code in VSCode and waits for the user to clode the vscode session. The user is able to add tests. |
|
3. The following will be tested: |
|
a. (Default & Compulsory) Code syntax; |
|
b. (Added by user) Any other tests. |
|
4. Runs the test and returns the output. |
|
|
|
*Input Interface*: |
|
- `code` (str): The code to be tested. |
|
|
|
*Output Interface*: |
|
- `feedback` (str): The test results. |
|
|
|
<a id="TestCodeFileEditAtomicFlow"></a> |
|
|
|
# TestCodeFileEditAtomicFlow |
|
|
|
<a id="TestCodeFileEditAtomicFlow.TestCodeFileEditAtomicFlow"></a> |
|
|
|
## TestCodeFileEditAtomicFlow Objects |
|
|
|
```python |
|
class TestCodeFileEditAtomicFlow(CodeFileEditAtomicFlow) |
|
``` |
|
|
|
Refer to: https://huggingface.co/Tachi67/CodeFileEditFlowModule/tree/main |
|
|
|
<a id="__init__"></a> |
|
|
|
# \_\_init\_\_ |
|
|
|
<a id="CodeTestingAtomicFlow"></a> |
|
|
|
# CodeTestingAtomicFlow |
|
|
|
<a id="CodeTestingAtomicFlow.CodeTestingAtomicFlow"></a> |
|
|
|
## CodeTestingAtomicFlow Objects |
|
|
|
```python |
|
class CodeTestingAtomicFlow(InterpreterAtomicFlow) |
|
``` |
|
|
|
This class inherits from InterpreterAtomicFlow and is used to test code. |
|
|
|
*Input Interface*: |
|
- `temp_code_file_location`: Location of the file containing the code to be tested. |
|
|
|
*Output Interface*: |
|
- `feedback`: Feedback from the test (i.e. test results). |
|
|
|
|