Vibora Docs
Search…
Testing
Testing is the most important part of any project with considerably size and yet of one of the most ignored steps.
Vibora has a builtin and fully featured async HTTP client and a simple test framework to make it easier for you as in the example bellow:
1
from vibora import Vibora, Response
2
from vibora.tests import TestSuite
3
4
app = Vibora()
5
6
7
@app.route('/')
8
async def home():
9
return Response(b'Hello World')
10
11
12
class HomeTestCase(TestSuite):
13
def setUp(self):
14
self.client = app.test_client()
15
16
async def test_home(self):
17
response = await self.client.get('/')
18
self.assertEqual(response.content, b'Hello World')
Copied!
Last modified 3yr ago
Copy link