Vibora Docs
v0.1.0
v0.1.0
  • Introduction
  • Routing
  • Components
    • Request Component
  • Responses
  • Data Validation
    • Fields
  • Events
  • Testing
    • Advanced Tips
  • Template Engine
    • Syntax
    • Extending
    • Performance
  • Logging
  • Configuration
  • Deployment
  • HTTP Client
    • Session
    • Useful Examples
  • Extensions
  • Contributing
  • FAQ
Powered by GitBook
On this page

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:

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')
PreviousEventsNextAdvanced Tips

Last updated 6 years ago