OLD | NEW |
| (Empty) |
1 # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
2 # See LICENSE for details. | |
3 | |
4 | |
5 from twisted.trial import unittest | |
6 from twisted.protocols import finger | |
7 from twisted.internet import reactor, protocol | |
8 from twisted.test import test_protocols | |
9 | |
10 class FingerTestCase(unittest.TestCase): | |
11 | |
12 def setUp(self): | |
13 self.t = test_protocols.StringIOWithoutClosing() | |
14 self.p = finger.Finger() | |
15 self.p.makeConnection(protocol.FileWrapper(self.t)) | |
16 | |
17 def testSimple(self): | |
18 self.p.dataReceived("moshez\r\n") | |
19 self.failUnlessEqual(self.t.getvalue(), | |
20 "Login: moshez\nNo such user\n") | |
21 | |
22 def testSimpleW(self): | |
23 self.p.dataReceived("/w moshez\r\n") | |
24 self.failUnlessEqual(self.t.getvalue(), | |
25 "Login: moshez\nNo such user\n") | |
26 | |
27 def testForwarding(self): | |
28 self.p.dataReceived("moshez@example.com\r\n") | |
29 self.failUnlessEqual(self.t.getvalue(), | |
30 "Finger forwarding service denied\n") | |
31 | |
32 def testList(self): | |
33 self.p.dataReceived("\r\n") | |
34 self.failUnlessEqual(self.t.getvalue(), | |
35 "Finger online list denied\n") | |
OLD | NEW |