import unittest
from app import app
class TestHello(unittest.TestCase):
    def setUp(self):
        app.testing = True
        self.app = app.test_client()
    def test_hello(self):
        rv = self.app.get('/')
        self.assertEqual(rv.status, '200 OK')
        self.assertEqual(rv.data, b'Hey, we have Python Flask in a Docker container!\n')

#Simple test report        
#if __name__ == '__main__':
#    unittest.main()

# Jenkins supports to represent the test reports with the JUnit format in the Blue Ocean, so we should change the output of the test like below
if __name__ == '__main__':
    import xmlrunner
    runner = xmlrunner.XMLTestRunner(output='test-reports')
    unittest.main(testRunner=runner)
