Remove surrounding quotes from TLS paths, if present
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
d29f8e1022
commit
c0305024f5
4 changed files with 48 additions and 3 deletions
23
tests/unit/cli/utils_test.py
Normal file
23
tests/unit/cli/utils_test.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
from compose.cli.utils import unquote_path
|
||||
|
||||
|
||||
class UnquotePathTest(unittest.TestCase):
|
||||
def test_no_quotes(self):
|
||||
assert unquote_path('hello') == 'hello'
|
||||
|
||||
def test_simple_quotes(self):
|
||||
assert unquote_path('"hello"') == 'hello'
|
||||
|
||||
def test_uneven_quotes(self):
|
||||
assert unquote_path('"hello') == '"hello'
|
||||
assert unquote_path('hello"') == 'hello"'
|
||||
|
||||
def test_nested_quotes(self):
|
||||
assert unquote_path('""hello""') == '"hello"'
|
||||
assert unquote_path('"hel"lo"') == 'hel"lo'
|
||||
assert unquote_path('"hello""') == 'hello"'
|
||||
Loading…
Add table
Add a link
Reference in a new issue