# Path: tests/test_api.py
# class TestAPIStatus(unittest.TestCase):
# 
#     @classmethod
#     def setUpClass(cls):
#         api.config['SERVER_NAME'] = "%s:%s" % (API.LISTEN_HOST, API.LISTEN_PORT)
#         cls.client = api.test_client()
# 
#     def setUp(self, status_text="ok"):
#         self.app_context = api.test_request_context()
#         self.app_context.push()
#         #self.expected_status = json.loads('{"status":"' + status_text + '"}')
# 
#     def tearDown(self):
#         self.app_context.pop()
# 
#     def test_status_endpoint(self):
#         resp = self.client.get("/status/")
#         self.assertEqual(resp.status_code, 200)
#         self.assertEqual(resp.mimetype, 'application/json')
# 
#         # todo: tame resp.data returning b'{\n  "status": "ok"\n}'
#         #self.assertEqual(resp.text, self.expected_status)


import unittest
from tests.test_api import TestAPIStatus


class TestGitHubAPI(TestAPIStatus):

    def test_github_endpoint(self):
        resp = self.client.get("/plugins/github")
        self.assertEqual(resp.status_code, 200)
        self.assertEqual(resp.mimetype, 'application/json')

        # todo: tame resp.data returning b'{\n  "status": "ok"\n}'
        #self.assertEqual(resp.text, self.expected_status)

    def test_github_status_endpoint(self):
        resp = self.client.get("/plugins/github/status")
        self.assertEqual(resp.status_code, 200)

# Path: tests/test_api.py
# class TestAPIStatus(unittest.TestCase):
# 
#     @classmethod
#     def setUpClass(cls):
#         api.config['SERVER_NAME'] = "%s:%s" % (API.LISTEN_HOST, API.LISTEN_PORT)
#         cls.client = api.test_client()
# 
#     def setUp(self, status_text="ok"):
#         self.app_context = api.test_request_context()
#         self.app_context.push()
#         #self.expected_status = json.loads('{"status":"' + status_text + '"}')
# 
#     def tearDown(self):
#         self.app_context.pop()
# 
#     def test_status_endpoint(self):
#         resp = self.client.get("/status/")
#         self.assertEqual(resp.status_code, 200)
#         self.assertEqual(resp.mimetype, 'application/json')
# 
#         # todo: tame resp.data returning b'{\n  "status": "ok"\n}'
#         #self.assertEqual(resp.text, self.expected_status)


# Path: tests/test_plugins/test_github.py
import unittest
from tests.test_api import TestAPIStatus



class TestGitHubAPI(TestAPIStatus):

    def test_github_endpoint(self):
        resp = self.client.get("/plugins/github")
        self.assertEqual(resp.status_code, 200)
        self.assertEqual(resp.mimetype, 'application/json')

        # todo: tame resp.data returning b'{\n  "status": "ok"\n}'
        #self.assertEqual(resp.text, self.expected_status)

    def test_github_status_endpoint(self):
        resp = self.client.get("/plugins/github/status")
        self.assertEqual(resp.status_code, 200)

        self.assertEqual(resp.mimetype, 'application/json')