from flask_testing import TestCase

from no_global_flask_app.views import index, foo, bar, get_app


class TestNGFAViews(TestCase):
    def create_app(self):
        self.app = get_app(True)
        self.client = self.app.test_client()
        return self.app

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_index(self):
        result = index()
        self.assertTrue(
            result is not None, f"Passing test should return non empty value {result}"
        )

    def test_foo(self):
        result = foo()
        self.assertTrue(
            result is not None, f"Passing test should return non empty value {result}"
        )

    def test_bar(self):
        result = bar(qs_bar="bar")
        self.assertTrue(
            result is not None, f"Passing test should return non empty value {result}"
        )
