Skip to content
This repository was archived by the owner on Oct 8, 2023. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 666 Bytes

File metadata and controls

28 lines (19 loc) · 666 Bytes

Testing

Testing is the most important part of any project with considerable size and yet one of the most ignored steps.

Vibora has a built-in and fully featured async HTTP client and a simple test framework to make it easier for you as in the example bellow:

from vibora import Vibora, Response
from vibora.tests import TestSuite

app = Vibora()


@app.route('/')
async def home():
    return Response(b'Hello World')


class HomeTestCase(TestSuite):
    def setUp(self):
        self.client = app.test_client()

    async def test_home(self):
        response = await self.client.get('/')
        self.assertEqual(response.content, b'Hello World')