mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-15 23:02:05 +03:00
tests/gateway/get_decompressed_message: 'plain_message' test working
This commit is contained in:
parent
e28ab45be4
commit
9d9b38227f
25
src/tests/gateway/test_get_decompressed_message.py
Normal file
25
src/tests/gateway/test_get_decompressed_message.py
Normal file
@ -0,0 +1,25 @@
|
||||
"""Tests for eddn.Gateway.get_decompressed_message."""
|
||||
import os
|
||||
from typing import Callable
|
||||
|
||||
|
||||
def test_plain_message(eddn_message: Callable, monkeypatch) -> None:
|
||||
"""Test eddn.Gateway.get_decompressed_message() with a plain message."""
|
||||
# Tests don't include the directory that `pytest` is run from on sys.path
|
||||
print(type(monkeypatch))
|
||||
monkeypatch.syspath_prepend(os.getcwd())
|
||||
import eddn.Gateway
|
||||
|
||||
eddn.Gateway.setup_bottle_app()
|
||||
print(f'{eddn.Gateway.app.__dict__=}')
|
||||
|
||||
msg = eddn_message('plain_journal_scan_valid')
|
||||
|
||||
dc_msg = eddn.Gateway.get_decompressed_message(
|
||||
{
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
msg.encode(encoding='utf-8'),
|
||||
)
|
||||
|
||||
assert msg == dc_msg.decode()
|
Loading…
x
Reference in New Issue
Block a user