-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip quotes from config entries (#7)
- Loading branch information
Showing
9 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.egg-info | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" Read each test vector, decrypt, and check that they're correct.""" | ||
import myloginpath | ||
|
||
|
||
def test_normal(): | ||
expected = """[test] | ||
user = testuser | ||
password = testpass | ||
host = testhost | ||
socket = testsocket | ||
port = 1234 | ||
""" | ||
actual = myloginpath.read("test/test.mylogin.cnf") | ||
assert expected == actual | ||
|
||
|
||
def test_quoted(): | ||
expected = """[test] | ||
user = "testuser" | ||
password = "testpass" | ||
host = "testhost" | ||
socket = "testsocket" | ||
port = 1234 | ||
""" | ||
actual = myloginpath.read("test/test_quoted.mylogin.cnf") | ||
assert expected == actual | ||
|
||
|
||
def test_special(): | ||
expected = """[test] | ||
host = "host with \\" quote" | ||
""" | ||
actual = myloginpath.read("test/test_special.mylogin.cnf") | ||
assert expected == actual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" Parse each test vector, and compare them to known-good values. """ | ||
import myloginpath | ||
|
||
|
||
def test_normal(): | ||
expected = { | ||
"host": "testhost", | ||
"password": "testpass", | ||
"port": 1234, | ||
"socket": "testsocket", | ||
"user": "testuser", | ||
} | ||
actual = myloginpath.parse("test", "test/test.mylogin.cnf") | ||
assert expected == actual | ||
|
||
|
||
def test_quoted(): | ||
expected = { | ||
"host": "testhost", | ||
"password": "testpass", | ||
"port": 1234, | ||
"socket": "testsocket", | ||
"user": "testuser", | ||
} | ||
actual = myloginpath.parse("test", "test/test_quoted.mylogin.cnf") | ||
assert expected == actual | ||
|
||
|
||
def test_special(): | ||
expected = {"host": 'host with " quote'} | ||
actual = myloginpath.parse("test", "test/test_special.mylogin.cnf") | ||
assert expected == actual |
Binary file not shown.
Binary file not shown.