- fixed test case

- attempting to up the websocket
This commit is contained in:
ari committed 2022-08-22 15:19:41 -04:00
1 parent b68962ccbb
commit 616c8c3b4b
5 files changed
+11 -4

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ RUN apt-get update -y && \
# <--- Scripts -->
COPY docker/bin /app/bin
COPY docker/hypercorn.toml /app/hypercorn.toml
# <--- PREP -->
RUN /app/bin/prep.sh
+6 -1
View File
@@ -34,7 +34,12 @@ class WSRedirector:
return await self._client.send(msg)
async def start(self):
async with connect(self._host) as websocket:
async with connect(
self._host,
max_size=16 * 2**20,
read_limit=16 * 2**20,
write_limit=16 * 2**20,
) as websocket:
self._client = websocket
await websocket.send(json.dumps({"type": "auth", "access_token": self._token}))
while not self.is_closed:
+1 -1
View File
@@ -12,4 +12,4 @@ echo "HOST = $host_port"
echo "HASSIO_WS = $HASSIO_WS"
echo $(python --version)
echo "--------------------"
python -m hypercorn src.app:app -b $host_port
python -m hypercorn src.app:app -b $host_port --config /app/hypercorn.toml
+1
View File
@@ -0,0 +1 @@
websocket_max_message_size = 16777216
+2 -2
View File
@@ -24,12 +24,12 @@ test("mock api uses initial autos for initial population -- some data", async ()
test("populate mock api with some data", async () => {
const mockApi = makeAutomationAPI(useMockAPI([], fakeUseRef as any));
await mockApi.update(createMockAuto());
await mockApi.create(createMockAuto());
let data = await mockApi.list({ limit: 10, offset: 0 });
expect(data.ok).toBe(true);
expect((data as any).data.data).toHaveLength(1);
expect((data as any).data.totalItems).toBe(1);
await mockApi.update(createMockAuto());
await mockApi.create(createMockAuto());
data = await mockApi.list({ limit: 10, offset: 0 });
expect((data as any).data.data).toHaveLength(2);
expect((data as any).data.totalItems).toBe(2);