vinissimus / async-asgi-testclient
Showing 1 of 4 files from the diff.

@@ -70,16 +70,17 @@
Loading
70 70
            raise Exception(message)
71 71
        return message["bytes"]
72 72
73 -
    async def receive_json(self, mode: str = "text"):
74 -
        assert mode in ["text", "binary"]
73 +
    async def receive_json(self):
75 74
        message = await self._receive()
76 75
        if message["type"] != "websocket.send":
77 76
            raise Exception(message)
78 -
        if mode == "text":
79 -
            text = message["text"]
77 +
        if "text" in message:
78 +
            data = message["text"]
79 +
        elif "bytes" in message:
80 +
            data = message["bytes"]
80 81
        else:
81 -
            text = message["bytes"].decode("utf-8")
82 -
        return json.loads(text)
82 +
            raise Exception(message)
83 +
        return json.loads(data)
83 84
84 85
    async def _receive(self):
85 86
        return await receive(self.output_queue)
Files Coverage
async_asgi_testclient 87.25%
Project Totals (6 files) 87.25%
184.1
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
184.2
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading