Skip to content

Commit

Permalink
Update tornado tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed Aug 5, 2019
1 parent b7ebb24 commit 9b44d6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .mypy_cache/3.6/test_tornado.data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{".class": "MypyFile", "_fullname": "test_tornado", "is_partial_stub_package": false, "is_stub": false, "names": {".class": "SymbolTable", "AsyncHTTPTestCase": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_suppressed_import"], "fullname": "test_tornado.AsyncHTTPTestCase", "name": "AsyncHTTPTestCase", "type": {".class": "AnyType", "missing_import_name": "test_tornado.AsyncHTTPTestCase", "source_any": null, "type_of_any": 3}}}, "Model": {".class": "SymbolTableNode", "cross_ref": "mesa.model.Model", "kind": "Gdef"}, "ModularServer": {".class": "SymbolTableNode", "cross_ref": "mesa.visualization.ModularVisualization.ModularServer", "kind": "Gdef"}, "TestServer": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "TypeInfo", "_promote": null, "abstract_attributes": [], "bases": ["builtins.object"], "declared_metaclass": null, "defn": {".class": "ClassDef", "fullname": "test_tornado.TestServer", "name": "TestServer", "type_vars": []}, "flags": ["fallback_to_any"], "fullname": "test_tornado.TestServer", "metaclass_type": null, "metadata": {}, "module_name": "test_tornado", "mro": ["test_tornado.TestServer", "builtins.object"], "names": {".class": "SymbolTable", "get_app": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0], "arg_names": ["self"], "flags": [], "fullname": "test_tornado.TestServer.get_app", "name": "get_app", "type": null}}, "test_homepage": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0], "arg_names": ["self"], "flags": [], "fullname": "test_tornado.TestServer.test_homepage", "name": "test_homepage", "type": null}}, "test_websocket": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "Decorator", "func": {".class": "FuncDef", "arg_kinds": [0], "arg_names": ["self"], "flags": ["is_generator", "is_decorated"], "fullname": "test_tornado.TestServer.test_websocket", "name": "test_websocket", "type": null}, "is_overload": false, "var": {".class": "Var", "flags": ["is_initialized_in_class"], "fullname": null, "name": "test_websocket", "type": {".class": "AnyType", "missing_import_name": "test_tornado.tornado", "source_any": {".class": "AnyType", "missing_import_name": "test_tornado.tornado", "source_any": null, "type_of_any": 3}, "type_of_any": 7}}}}}, "tuple_type": null, "type_vars": [], "typeddict_type": null}}, "__doc__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "test_tornado.__doc__", "name": "__doc__", "type": "builtins.str"}}, "__file__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "test_tornado.__file__", "name": "__file__", "type": "builtins.str"}}, "__name__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "test_tornado.__name__", "name": "__name__", "type": "builtins.str"}}, "__package__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "test_tornado.__package__", "name": "__package__", "type": "builtins.str"}}, "json": {".class": "SymbolTableNode", "cross_ref": "json", "kind": "ModuleRef"}, "tornado": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_suppressed_import"], "fullname": "test_tornado.tornado", "name": "tornado", "type": {".class": "AnyType", "missing_import_name": "test_tornado.tornado", "source_any": null, "type_of_any": 3}}}}, "path": "c:\\Users\\Vincent\\OneDrive\\mesa\\tests\\test_tornado.py"}
1 change: 1 addition & 0 deletions .mypy_cache/3.6/test_tornado.meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"child_modules": [], "data_mtime": 1564998707, "dep_lines": [3, 4, 5, 1, 1, 1, 1, 1, 1, 2], "dep_prios": [5, 5, 10, 5, 30, 30, 30, 30, 5, 10], "dependencies": ["mesa", "mesa.visualization.ModularVisualization", "json", "builtins", "abc", "mesa.model", "mesa.visualization", "typing"], "deps_mtime": null, "hash": "2e464cdf7fefc1c16552c8481d6680bd", "id": "test_tornado", "ignore_all": false, "interface_hash": "f3a005d50a7f3b5cad1829cb7deac5c0", "mtime": 1564999144, "options": {"allow_untyped_globals": false, "always_false": [], "always_true": [], "bazel": false, "check_untyped_defs": false, "disallow_any_decorated": false, "disallow_any_explicit": false, "disallow_any_expr": false, "disallow_any_generics": false, "disallow_any_unimported": false, "disallow_incomplete_defs": false, "disallow_subclassing_any": false, "disallow_untyped_calls": false, "disallow_untyped_decorators": false, "disallow_untyped_defs": false, "follow_imports": "silent", "follow_imports_for_stubs": false, "ignore_errors": false, "ignore_missing_imports": true, "local_partial_types": false, "mypyc": false, "no_implicit_optional": false, "platform": "win32", "plugins": [], "show_none_errors": true, "strict_optional": true, "strict_optional_whitelist": null, "warn_no_return": true, "warn_return_any": false, "warn_unused_ignores": false}, "path": "c:\\Users\\Vincent\\OneDrive\\mesa\\tests\\test_tornado.py", "size": 1309, "suppressed": ["tornado.testing", "tornado"], "version_id": "0.660"}
9 changes: 4 additions & 5 deletions tests/test_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ def test_websocket(self):
ws_client = yield tornado.websocket.websocket_connect(ws_url)

# Now we can run a test on the WebSocket.
ws_client.write_message('{"type": "get_step"}')
response = yield ws_client.read_message()
msg = json.loads(response)
assert msg["type"] == "viz_state"
assert msg["type"] == "model_params"

ws_client.write_message('{"type": "reset"}')
ws_client.write_message('{"type": "get_step"}')
response = yield ws_client.read_message()
msg = json.loads(response)
assert msg["type"] == "viz_state"

ws_client.write_message('{"type": "get_params"}')
ws_client.write_message('{"type": "reset"}')
response = yield ws_client.read_message()
msg = json.loads(response)
assert msg["type"] == "model_params"
assert msg["type"] == "viz_state"

ws_client.write_message("Unknown message!")
response = yield ws_client.read_message()
Expand Down

0 comments on commit 9b44d6d

Please sign in to comment.