-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from PMCC-BioinformaticsCore/sanitise-parammeta
Sanitise param meta + other values
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
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,17 @@ | ||
import unittest | ||
|
||
from wdlgen import ParameterMeta | ||
|
||
|
||
class TestParamMeta(unittest.TestCase): | ||
def test_quote_sanitise(self): | ||
meta = ParameterMeta(foo='"bar"').get_string() | ||
self.assertEqual('foo: "\\"bar\\""', meta) | ||
|
||
def test_nl_sanitise(self): | ||
meta = ParameterMeta(foo="bar\nbaz").get_string() | ||
self.assertEqual('foo: "bar\\nbaz"', meta) | ||
|
||
def test_backslackquote_sanitise(self): | ||
meta = ParameterMeta(foo='bar\\"').get_string() | ||
self.assertEqual('foo: "bar\\\\\\""', meta) |
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