Добавил немного тестов. Поправил README.
This commit is contained in:
parent
683a9f8d09
commit
642fd8068b
31
README.md
31
README.md
@ -1,2 +1,31 @@
|
||||
# advanced-python-homework-2023
|
||||
## advanced-python-homework-2023
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install `Python`
|
||||
|
||||
2. Install `python3-venv` by the following command: `apt install python3-venv`
|
||||
|
||||
3. Create and activate your virtual environment following the [instructions](https://docs.python.org/3/tutorial/venv.html)
|
||||
|
||||
4. Install the `requirements.txt` dependencies following the commands:
|
||||
```
|
||||
cd ./scada_system
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
|
||||
5. Install the package in editable mode:
|
||||
```
|
||||
pip3 install -e .
|
||||
```
|
||||
|
||||
6. To generate documentation in HTML format, you need to run the following commands:
|
||||
```
|
||||
cd ./docs
|
||||
make html
|
||||
```
|
||||
## Tests
|
||||
1. To run the tests, go to the `scada_system` directory and run the following command:
|
||||
```
|
||||
python3 -m unittest
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
## Installation
|
||||
|
||||
1. Install `Python`
|
||||
|
||||
2. Install `python3-venv` by the following command: `apt install python3-venv`
|
||||
|
||||
3. Create and activate your virtual environment following the [instructions](https://docs.python.org/3/tutorial/venv.html)
|
||||
|
||||
4. Install the `requirements.txt` dependencies following the commands:
|
||||
```
|
||||
cd ./scada_system
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
|
||||
5. Install the package in editable mode:
|
||||
```
|
||||
pip3 install -e .
|
||||
```
|
||||
|
||||
6. To generate documentation in HTML format, you need to run the following commands:
|
||||
```
|
||||
cd ./docs
|
||||
make html
|
||||
```
|
0
scada_system/tests/__init__.py
Normal file
0
scada_system/tests/__init__.py
Normal file
0
scada_system/tests/controls/__init__.py
Normal file
0
scada_system/tests/controls/__init__.py
Normal file
@ -9,4 +9,6 @@ class DeviceLifecycleStateTest(TestCase):
|
||||
pass
|
||||
|
||||
def test_enum(self):
|
||||
self.assertEqual(DeviceLifecycleStateTest["INIT"], DeviceLifecycleStateTest.INIT)
|
||||
self.assertEqual(DeviceLifecycleState["INIT"], DeviceLifecycleState.INIT)
|
||||
self.assertEqual(DeviceLifecycleState["OPEN"], DeviceLifecycleState.OPEN)
|
||||
self.assertEqual(DeviceLifecycleState["CLOSE"], DeviceLifecycleState.CLOSE)
|
||||
|
0
scada_system/tests/equipment/__init__.py
Normal file
0
scada_system/tests/equipment/__init__.py
Normal file
@ -1,5 +1,4 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from equipment.turtle_device import TurtleDevice
|
||||
|
||||
|
||||
@ -10,4 +9,10 @@ class TurtleDeviceTest(TestCase):
|
||||
|
||||
def test_open(self):
|
||||
self.device.open()
|
||||
self.device.execute('forward', 100)
|
||||
self.device.execute('left', 90)
|
||||
self.device.execute('right', 90)
|
||||
self.device.execute('color', 'red')
|
||||
self.device.execute('circle', 120, 180)
|
||||
self.device.execute('home')
|
||||
self.device.close()
|
Loading…
Reference in New Issue
Block a user