Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: third_party/twisted_8_1/twisted/test/test_strports.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 #
5 from twisted.application import strports
6 from twisted.trial import unittest
7
8 class ParserTestCase(unittest.TestCase):
9
10 f = "Factory"
11
12 def testSimpleNumeric(self):
13 self.assertEqual(strports.parse('80', self.f),
14 ('TCP', (80, self.f), {'interface':'', 'backlog':50}))
15
16 def testSimpleTCP(self):
17 self.assertEqual(strports.parse('tcp:80', self.f),
18 ('TCP', (80, self.f), {'interface':'', 'backlog':50}))
19
20 def testInterfaceTCP(self):
21 self.assertEqual(strports.parse('tcp:80:interface=127.0.0.1', self.f),
22 ('TCP', (80, self.f),
23 {'interface':'127.0.0.1', 'backlog':50}))
24
25 def testBacklogTCP(self):
26 self.assertEqual(strports.parse('tcp:80:backlog=6', self.f),
27 ('TCP', (80, self.f),
28 {'interface':'', 'backlog':6}))
29
30 def testSimpleUnix(self):
31 self.assertEqual(strports.parse('unix:/var/run/finger', self.f),
32 ('UNIX', ('/var/run/finger', self.f),
33 {'mode':0666, 'backlog':50}))
34
35 def testModedUNIX(self):
36 self.assertEqual(strports.parse('unix:/var/run/finger:mode=0660',
37 self.f),
38 ('UNIX', ('/var/run/finger', self.f),
39 {'mode':0660, 'backlog':50}))
40
41 def testAllKeywords(self):
42 self.assertEqual(strports.parse('port=80', self.f),
43 ('TCP', (80, self.f), {'interface':'', 'backlog':50}))
44
45 def testEscape(self):
46 self.assertEqual(strports.parse(r'unix:foo\:bar\=baz\:qux\\', self.f),
47 ('UNIX', ('foo:bar=baz:qux\\', self.f),
48 {'mode':0666, 'backlog':50}))
49
50 def testImpliedEscape(self):
51 self.assertEqual(strports.parse(r'unix:address=foo=bar', self.f),
52 ('UNIX', ('foo=bar', self.f),
53 {'mode':0666, 'backlog':50}))
54
55 def testNonstandardDefault(self):
56 self.assertEqual(strports.parse('filename', self.f, 'unix'),
57 ('UNIX', ('filename', self.f),
58 {'mode':0666, 'backlog':50}))
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/test/test_strerror.py ('k') | third_party/twisted_8_1/twisted/test/test_task.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698