def alfacoins_mockup_gateway(root_controller): app = Application(root_controller) with mockup_http_server(app) as (server, url): yield ALFACoins( name='test-shop', password='******', secret_key='d53974471e9b555554f5c318e07e9f23', base_url=urljoin(url, '/api/'), )
def test_quickstart_with_application(run_quickstart): class Root(Controller): @action def index(self): yield f'Index' url = run_quickstart(application=Application(Root())) response = requests.get(url) assert response.status_code == 200 assert response.text == 'Index'
def Given(controller, *args, configuration=None, **kwargs): if configuration: configure(configuration, force=True) else: configure(force=True) if isinstance(controller, Application): application = controller else: application = Application(controller) return bddrest.Given(application, None, *args, **kwargs)
def unauthorized_alfacoins_mockup_gateway(root_controller): app = Application(root_controller) with mockup_http_server(app) as (server, url): yield ALFACoins( base_url=urljoin(url, '/api/'), )