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