Skip to content

Commit

Permalink
Add requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Haakon Karstensen authored and Haakon Karstensen committed Nov 2, 2024
1 parent f5005f9 commit ccc6834
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 20 deletions.
8 changes: 4 additions & 4 deletions client/src/services/AssertNodeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function createApiAssertNode(
label: string,
apiUrl: string,
expectedApiResponse: string,
apiAction?: string
apiPayload: string
): CustomAssertNode {
return {
id: generateUniqueId(),
Expand All @@ -16,7 +16,7 @@ export function createApiAssertNode(
assertionMethod: 'API',
apiUrl,
expectedApiResponse,
apiAction
apiPayload
},
position: { x: 0, y: 0 }
}
Expand Down Expand Up @@ -84,8 +84,8 @@ function generateUniqueId(): string {
async function submitApiCheck(
nodeId: number | string,
apiUrl: string,
apiPayload: object,
expectedResponse: object
apiPayload: string,
expectedResponse: string
) {
try {
const response = await fetch(`/check_assertion/${nodeId}/`, {
Expand Down
29 changes: 14 additions & 15 deletions client/src/types/NodeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ export type CustomData = {
fields?: { uuid?: string; action?: string; assertion?: string }
}

export type CustomAssertData = CustomData &
(
| {
assertionMethod: 'API'
apiUrl: string
apiAction?: any
expectedApiResponse: any
}
| {
assertionMethod: 'UART'
expectedUARTLog: string
timeout: number
}
)
export type CustomAssertData = CustomData & (
| {
assertionMethod: 'API'
apiUrl: string
apiPayload: string
expectedApiResponse: string
}
| {
assertionMethod: 'UART'
expectedUARTLog: string
timeout: number
}
)

export type CustomNode = Node<CustomData>

export type CustomAssertNode = Node<CustomAssertData>
export type CustomAssertNode = Node<CustomAssertData>
104 changes: 104 additions & 0 deletions server/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
alabaster==1.0.0
asgiref==3.8.1
async-timeout==4.0.3
attrs==23.2.0
autobahn==24.4.2
Automat==24.8.1
babel==2.16.0
black==24.8.0
certifi==2024.8.30
cffi==1.16.0
channels==4.1.0
channels-redis==4.2.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
constantly==23.10.4
coverage==7.6.1
cryptography==42.0.5
daphne==4.1.2
Django==5.1.1
django-cors-headers==4.5.0
django-filter==24.3
django-filter-stubs==0.1.3
django-stubs==5.1.0
django-stubs-ext==5.1.0
djangorestframework==3.15.2
djangorestframework-stubs==3.15.1
docutils==0.21.2
exceptiongroup==1.2.2
flake8==7.1.1
hyperlink==21.0.0
idna==3.10
imagesize==1.4.1
importlib_metadata==8.5.0
incremental==24.7.2
iniconfig==2.0.0
isort==5.13.2
jaraco.classes==3.4.0
jeepney==0.8.0
Jinja2==3.1.4
keyring==23.13.1
lxml==4.9.4
MarkupSafe==2.1.5
mccabe==0.7.0
more-itertools==10.2.0
msgpack==1.1.0
mypy==1.11.2
mypy-extensions==1.0.0
openconnect-sso==0.8.1
packaging==24.1
pathspec==0.12.1
platformdirs==4.3.6
pluggy==1.5.0
prompt-toolkit==3.0.43
psycopg2==2.9.9
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycodestyle==2.12.1
pycparser==2.22
pyflakes==3.2.0
Pygments==2.18.0
pyOpenSSL==24.2.1
pyotp==2.9.0
PyQt6==6.7.0
PyQt6-Qt6==6.7.0
PyQt6-sip==13.6.0
PyQt6-WebEngine==6.7.0
PyQt6-WebEngine-Qt6==6.7.0
pyserial==3.5
PySocks==1.7.1
pytest==8.3.3
pytest-asyncio==0.24.0
python-dotenv==1.0.1
pywin32-ctypes==0.2.3
pyxdg==0.28
redis==5.1.1
requests==2.32.3
SecretStorage==3.3.3
service-identity==24.1.0
setuptools==69.5.1
snowballstemmer==2.2.0
Sphinx==8.0.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
sqlparse==0.5.1
structlog==24.1.0
toml==0.10.2
tomli==2.0.1
Twisted==24.7.0
txaio==23.1.1
types-pyserial==3.5.0.20240826
types-PyYAML==6.0.12.20240917
types-requests==2.32.0.20240914
typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.3
wcwidth==0.2.13
websockets==13.1
zipp==3.20.2
zope.interface==7.1.0
3 changes: 2 additions & 1 deletion server/server_comm/assertions/views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from . import logic
from data_manager.models import Node
from django.forms import ValidationError
from django.http import HttpResponseBadRequest, JsonResponse

from . import logic


async def check_assertion_view(request, node_id):
if request.method == "POST":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Generated by Django 5.1.1 on 2024-11-02 14:00

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
(
'data_manager',
'0006_device_communication_ids_alter_flow_edges_and_more',
),
]

operations = [
migrations.AddField(
model_name='node',
name='api_payload',
field=models.JSONField(blank=True, null=True),
),
migrations.AddField(
model_name='node',
name='api_url',
field=models.URLField(blank=True, null=True),
),
migrations.AddField(
model_name='node',
name='assertion_method',
field=models.CharField(
blank=True,
choices=[('api', 'API'), ('uart', 'UART')],
max_length=50,
null=True,
),
),
migrations.AddField(
model_name='node',
name='expected_response',
field=models.JSONField(blank=True, null=True),
),
migrations.AddField(
model_name='node',
name='expected_uart_log',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='node',
name='timeout',
field=models.PositiveIntegerField(default=5),
),
]

0 comments on commit ccc6834

Please sign in to comment.