093e3bd05477 — Oben Sonne 10 years ago
server: improve bad client tests
1 files changed, 26 insertions(+), 9 deletions(-)

M server/src/tests/test_badclient.py
M server/src/tests/test_badclient.py +26 -9
@@ 3,23 3,18 @@ Test session with Bong player.
 
 """
 
-import os
+import json
 import time
-import tempfile
-import textwrap
+
 
-import json
-
-from . import Client, Server, Process, log, BINDIR
+from . import Client, Server
 
 WAIT_FOR_PLAYER_UPDATE = 2
 
-
-def test_1(runningplayers=(), **helloparams):
+def test_malformedmessages(runningplayers=(), **helloparams):
 
     s = Server()
     time.sleep(1)
-
     c = Client()
     c.exp("""
         - hello

          
@@ 61,3 56,25 @@ def test_1(runningplayers=(), **hellopar
     c.disconnect()
     s.stop()
 
+def test_badstates(runningplayers=(), **helloparams):
+
+    s = Server()
+    time.sleep(1)
+    c = Client()
+    c.exp("""
+        - hello
+        - version: "1.0"
+    """)
+
+    c.snd("""
+        - setplaying
+        - enabled: true
+    """)
+    c.exp("""
+        - bounce
+        - reason: command not allowed at current session state
+          xcmd: setplaying
+    """)
+
+    c.disconnect()
+    s.stop()