~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/python/test/test_win32.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

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