Skip to content

Commit 41f6bae

Browse files
committed
maj tools/tests
1 parent 223ff37 commit 41f6bae

File tree

5 files changed

+135
-19
lines changed

5 files changed

+135
-19
lines changed

tests/workflow_api.py

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import requests
2+
from requests.auth import HTTPBasicAuth
3+
4+
IP = "192.168.1.79"
5+
PORT = 80
6+
7+
IP = "funhouse"
8+
PORT = 8080
9+
10+
auth = HTTPBasicAuth("", "passw0rd")
11+
12+
############################################################
13+
14+
with requests.options(
15+
f"http://{IP}:{PORT}/fs/",
16+
headers={
17+
"Accept": "application/json",
18+
},
19+
auth=auth
20+
) as r:
21+
print("-"*70)
22+
print(" ", r.status_code)
23+
print(r.content)
24+
print(r.headers)
25+
26+
"""
27+
print("Reading /fs/")
28+
29+
with requests.get(
30+
f"http://{IP}:{PORT}/fs/",
31+
headers={"Accept": "application/json"},
32+
auth=auth
33+
) as r:
34+
print("-"*70)
35+
print(" ", r.status_code)
36+
print(r.json())
37+
38+
with requests.options(
39+
f"http://{IP}:{PORT}/fs/",
40+
headers={"Accept": "application/json"},
41+
auth=auth
42+
) as r:
43+
print("-"*70)
44+
print(" ", r.status_code)
45+
print(r.content)
46+
print(r.headers)
47+
48+
with requests.get(
49+
f"http://{IP}:{PORT}/cp/version.json",
50+
headers={"Accept": "application/json"},
51+
auth=auth
52+
) as r:
53+
print("-"*70)
54+
print(" ", r.status_code)
55+
print(r.content)
56+
print(r.headers)
57+
58+
with requests.get(
59+
f"http://{IP}:{PORT}/fs/lib/",
60+
headers={"Accept": "application/json"},
61+
auth=auth
62+
) as r:
63+
print("-"*70)
64+
print(" ", r.status_code)
65+
print(r.json())
66+
"""
67+
68+
############################################################
69+
70+
# print("Creating a test dir")
71+
#
72+
# with requests.put(
73+
# f"http://{IP}:{PORT}/fs/test/",
74+
# auth=auth
75+
# ) as r:
76+
# print(" ", r.status_code)
77+
78+
# print("delete the directory for tests")
79+
#
80+
# with requests.delete(
81+
# f"http://{IP}:{PORT}/fs/test/",
82+
# auth=auth
83+
# ) as r:
84+
# print(" ", r.status_code)
85+
86+
############################################################
87+
88+
# print("Uploading a test file")
89+
#
90+
# with requests.put(
91+
# f"http://{IP}:{PORT}/fs/test.py",
92+
# 'print("Hello ESP32 V2!")',
93+
# auth=auth
94+
# ) as r:
95+
# print(" ", r.status_code)
96+
97+
############################################################
98+
99+
# try:
100+
# print("Reading /fs/ a second time")
101+
#
102+
# with requests.get(
103+
# f"http://{IP}:{PORT}/fs/",
104+
# headers={"Accept": "application/json"},
105+
# auth=auth
106+
# ) as r:
107+
# print(" ", r.status_code, "a file:", r.json()[0]["name"])
108+
# except requests.exceptions.ConnectionError as ex:
109+
# print(" FAILED reading")
110+

tools/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2022 Neradoc, https://neradoc.me
33
# SPDX-License-Identifier: MIT
44

5-
npx electron-forge make --platform=linux --arch=x64
65
npm run make
6+
python -c 'print("#"*70)'
7+
echo "npx electron-forge make --platform=linux --arch=x64"

tools/curl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
curl -L -u ":passw0rd" -H "Accept: application/json" http://cpy-46aeb4.local/fs/

tools/run.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ fi
2222
if [[ "$1" == "SCROUBOULIFLIPELCHABIDOU" ]]
2323
then
2424

25-
npm i -D electron
26-
npm i -D electron-rebuild
27-
./node_modules/.bin/electron-rebuild
28-
npm i drivelist
29-
./node_modules/.bin/electron-rebuild
30-
npm i fs-extra
31-
./node_modules/.bin/electron-rebuild
32-
npm i multicast-dns
33-
./node_modules/.bin/electron-rebuild
34-
npm i node-powershell
35-
./node_modules/.bin/electron-rebuild
36-
npm i path
37-
./node_modules/.bin/electron-rebuild
38-
39-
npm install --save-dev @electron-forge/cli
40-
npx electron-forge import
41-
42-
npm run make
25+
npm i -D electron
26+
npm i -D electron-rebuild
27+
./node_modules/.bin/electron-rebuild
28+
npm i drivelist
29+
./node_modules/.bin/electron-rebuild
30+
npm i fs-extra
31+
./node_modules/.bin/electron-rebuild
32+
npm i multicast-dns
33+
./node_modules/.bin/electron-rebuild
34+
npm i node-powershell
35+
./node_modules/.bin/electron-rebuild
36+
npm i path
37+
./node_modules/.bin/electron-rebuild
38+
39+
npm install --save-dev @electron-forge/cli
40+
npx electron-forge import
41+
42+
npm run make
4343

4444
fi

tools/setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
nodeenv --verbose --node=18.15.0 --jobs=4 --prebuilt venv
3+
. env/bin/activate

0 commit comments

Comments
 (0)