blob: e262ea2b6b07ee792922371984a5908f96e4f8ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.python.runtime import platform
from twisted.python.win32 import cmdLineQuote
class CommandLineQuotingTests(unittest.TestCase):
"""
Tests for L{cmdLineQuote}.
"""
def test_argWithoutSpaces(self):
"""
Calling C{cmdLineQuote} with an argument with no spaces should
return the argument unchanged.
"""
self.assertEqual(cmdLineQuote('an_argument'), 'an_argument')
def test_argWithSpaces(self):
"""
Calling C{cmdLineQuote} with an argument containing spaces should
return the argument surrounded by quotes.
"""
self.assertEqual(cmdLineQuote('An Argument'), '"An Argument"')
def test_emptyStringArg(self):
"""
Calling C{cmdLineQuote} with an empty string should return a
quoted empty string.
"""
self.assertEqual(cmdLineQuote(''), '""')
|