1
# Copyright (c) 2010 Twisted Matrix Laboratories.
2
# See LICENSE for details.
4
from twisted.trial import unittest
5
from twisted.python.runtime import platform
6
from twisted.python.win32 import cmdLineQuote
9
class CommandLineQuotingTests(unittest.TestCase):
11
Tests for L{cmdLineQuote}.
14
def test_argWithoutSpaces(self):
16
Calling C{cmdLineQuote} with an argument with no spaces should
17
return the argument unchanged.
19
self.assertEquals(cmdLineQuote('an_argument'), 'an_argument')
22
def test_argWithSpaces(self):
24
Calling C{cmdLineQuote} with an argument containing spaces should
25
return the argument surrounded by quotes.
27
self.assertEquals(cmdLineQuote('An Argument'), '"An Argument"')
30
def test_emptyStringArg(self):
32
Calling C{cmdLineQuote} with an empty string should return a
35
self.assertEquals(cmdLineQuote(''), '""')