Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Mock service leveraging kuksa client lib #88

2 changes: 1 addition & 1 deletion .github/workflows/mock_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
shell: bash
working-directory: mock_service
run: |
python3 -m pip install -r ./requirements.txt
python3 -m pip install --pre -r ./requirements.txt
python3 -m pip install -r ./requirements-dev.txt

- name: Run tests
Expand Down
4 changes: 4 additions & 0 deletions mock_service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ API documentation is generated from Python docs and embedded into markdown files
```bash
./update-api-docs.sh
```

# What's not supported?
Any form of array support e.g no VSS datapoint that has DataType.*ARRAY.
If values in Kuksa Databroker are modified outside of behaviors, the changes won't be picked up by the mock service. Instead try to model another behavior that listens to ACTUATOR_TARGET/VALUE and set it like this.
2 changes: 1 addition & 1 deletion mock_service/doc/pydoc/loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PythonDslLoader(MockLoader)
#### load

```python
def load(vdb_metadata) -> LoaderResult
def load(client) -> LoaderResult
```

Load mocking configuration from Python script.
Expand Down
24 changes: 23 additions & 1 deletion mock_service/doc/pydoc/mocking-dsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```python
def mock_datapoint(path: str,
initial_value: Any,
behaviors: List[Behavior] = list())
behaviors: List[Behavior] = None)
```

Mock a single datapoint.
Expand Down Expand Up @@ -117,3 +117,25 @@ See `__resolve_value` for documentation of value resolution.

- `AnimationAction` - The created AnimationAction.

<a id="lib.dsl.create_event_trigger"></a>

#### create\_event\_trigger

```python
def create_event_trigger(type: EventType,
path: Optional[str] = None) -> EventTrigger
```

Create an EventTrigger for the mocked datapoint in context of this call OR the explicitly passed one.

**Arguments**:

- `type` _EventType_ - The type of event which will activate the trigger.
- `path` _Optional[str]_ - The data point which shall raise the event.
If not set defaults to the mocked data point in context of the call.


**Returns**:

- `EvenTrigger` - The created EventTrigger.

Empty file removed mock_service/kuksa/__init__.py
Empty file.
Empty file removed mock_service/kuksa/val/__init__.py
Empty file.
Empty file.
305 changes: 0 additions & 305 deletions mock_service/kuksa/val/v1/types_pb2.py

This file was deleted.

4 changes: 0 additions & 4 deletions mock_service/kuksa/val/v1/types_pb2_grpc.py

This file was deleted.

139 changes: 0 additions & 139 deletions mock_service/kuksa/val/v1/val_pb2.py

This file was deleted.

Loading