Remove UTF-8 encoding header from Python files
[mudpy.git] / bin / test
1 #!/usr/bin/env python
2 """Regression test script for the mudpy engine."""
3
4 # Copyright (c) 2004-2015 Jeremy Stanley <fungi@yuggoth.org>. Permission
5 # to use, copy, modify, and distribute this software is granted under
6 # terms provided in the LICENSE file distributed with this software.
7
8 import telnetlib
9
10 conversation = (
11     ("Identify yourself:", "testuser"),
12     ("Enter your choice:", "n"),
13     ("Enter a new password for \"testuser\":", "Test123"),
14     ("Enter the same new password again:", "Test123"),
15     ("What would you like to do?", "c"),
16     ("Pick a gender for your new avatar:", "f"),
17     ("Choose a name for her:", "1"),
18     ("What would you like to do?", "a"),
19     ("Whom would you like to awaken?", ""),
20     (">", "quit"),
21     ("What would you like to do?", "d"),
22     ("Whom would you like to delete?", ""),
23     ("What would you like to do?", "p"),
24     ("permanently delete your account?", "y"),
25     ("Disconnecting...", ""),
26 )
27
28 mud = telnetlib.Telnet()
29 mud.open("::1", 6669)
30 for question, answer in conversation:
31     mud.read_until(("%s " % question).encode("utf-8"))
32     mud.write(("%s\r\n" % answer).encode("utf-8"))
33 mud.close()