From 2bc66225def9c4d4e18b169d71cf59e24c64903a Mon Sep 17 00:00:00 2001 From: josephlim94 Date: Sat, 17 Nov 2018 12:27:46 +0800 Subject: [PATCH] remove duplicate test folder (#244) --- tests/tests/__init__.py | 0 tests/tests/test_app.py | 73 ----------------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 tests/tests/__init__.py delete mode 100755 tests/tests/test_app.py diff --git a/tests/tests/__init__.py b/tests/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/tests/test_app.py b/tests/tests/test_app.py deleted file mode 100755 index fe4c5c0..0000000 --- a/tests/tests/test_app.py +++ /dev/null @@ -1,73 +0,0 @@ -""" -Unit tests - -Run from top level directory: ./tests/test_app.py - -See more on testing Flask apps: http://flask.pocoo.org/docs/0.11/testing/ -""" - -import unittest -from gdbgui import backend -import sys -from flask_socketio import send - - -PYTHON3 = sys.version_info.major == 3 - -backend.setup_backend(testing=True) -socketio = backend.socketio - - -@socketio.on("connect") -def on_connect(): - send("connected") - - -class TestWebsockets(unittest.TestCase): - @classmethod - def setUp(self): - pass - - def tearDown(self): - pass - - def test_connect(self): - client = socketio.test_client(backend.app) - received = client.get_received() - self.assertEqual(len(received), 1) - self.assertEqual(received[0]["args"], "connected") - client.disconnect() - - -class Test(unittest.TestCase): - def setUp(self): - """Built-in to unittest.TestCase""" - self.app = backend.app.test_client() - - def tearDown(self): - """Built-in to unittest.TestCase""" - pass - - def test_load_main_page(self): - response = self.app.get("/") - assert response.status_code == 200 - data = response.data.decode() if PYTHON3 else response.data - assert "" in data - - -def main(): - loader = unittest.TestLoader() - suite = unittest.TestSuite() - - # commented out for now, seems to be a flask_socketio issue - # https://github.com/miguelgrinberg/Flask-SocketIO/issues/405 - suite.addTests(loader.loadTestsFromTestCase(TestWebsockets)) - suite.addTests(loader.loadTestsFromTestCase(Test)) - - runner = unittest.TextTestRunner(verbosity=1) - result = runner.run(suite) - return len(result.errors) + len(result.failures) - - -if __name__ == "__main__": - main()