本文整理汇总了Python中supervisor.datatypes.dict_of_key_value_pairs函数的典型用法代码示例。如果您正苦于以下问题:Python dict_of_key_value_pairs函数的具体用法?Python dict_of_key_value_pairs怎么用?Python dict_of_key_value_pairs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dict_of_key_value_pairs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dict_of_key_value_pairs_handles_unquoted_non_alphanum
def test_dict_of_key_value_pairs_handles_unquoted_non_alphanum(self):
actual = datatypes.dict_of_key_value_pairs(
'HOME=/home/auser,FOO=/.foo+(1.2)-_/,'
'SUPERVISOR_SERVER_URL=http://127.0.0.1:9001')
expected = {'HOME': '/home/auser', 'FOO': '/.foo+(1.2)-_/',
'SUPERVISOR_SERVER_URL': 'http://127.0.0.1:9001'}
self.assertEqual(actual, expected)
示例2: test_dict_of_key_value_pairs_returns_empty_dict_for_empty_str
def test_dict_of_key_value_pairs_returns_empty_dict_for_empty_str(self):
actual = datatypes.dict_of_key_value_pairs("")
self.assertEqual({}, actual)
示例3: test_dict_of_key_value_pairs_allows_trailing_comma
def test_dict_of_key_value_pairs_allows_trailing_comma(self):
actual = datatypes.dict_of_key_value_pairs("foo=bar,")
expected = {"foo": "bar"}
self.assertEqual(actual, expected)
示例4: test_dict_of_key_value_pairs_handles_unquoted_non_alphanum
def test_dict_of_key_value_pairs_handles_unquoted_non_alphanum(self):
actual = datatypes.dict_of_key_value_pairs(
"HOME=/home/auser,FOO=/.foo+(1.2)-_/," "SUPERVISOR_SERVER_URL=http://127.0.0.1:9001"
)
expected = {"HOME": "/home/auser", "FOO": "/.foo+(1.2)-_/", "SUPERVISOR_SERVER_URL": "http://127.0.0.1:9001"}
self.assertEqual(actual, expected)
示例5: test_dict_of_key_value_pairs_handles_commas_inside_quotes
def test_dict_of_key_value_pairs_handles_commas_inside_quotes(self):
actual = datatypes.dict_of_key_value_pairs('foo="bar,baz",baz="q,ux"')
expected = {"foo": "bar,baz", "baz": "q,ux"}
self.assertEqual(actual, expected)
示例6: test_dict_of_key_value_pairs_handles_commas_inside_apostrophes
def test_dict_of_key_value_pairs_handles_commas_inside_apostrophes(self):
actual = datatypes.dict_of_key_value_pairs("foo='bar,baz',baz='q,ux'")
expected = {"foo": "bar,baz", "baz": "q,ux"}
self.assertEqual(actual, expected)
示例7: test_handles_empty_inside_quotes_with_second_unquoted_pair
def test_handles_empty_inside_quotes_with_second_unquoted_pair(self):
actual = datatypes.dict_of_key_value_pairs('foo="",bar=a')
expected = {'foo': '', 'bar': 'a'}
self.assertEqual(actual, expected)
示例8: test_dict_of_key_value_pairs_returns_dict_even_if_whitespace
def test_dict_of_key_value_pairs_returns_dict_even_if_whitespace(self):
actual = datatypes.dict_of_key_value_pairs(" foo = bar , baz = qux ")
expected = {"foo": "bar", "baz": "qux"}
self.assertEqual(actual, expected)
示例9: test_dict_of_key_value_pairs_returns_dict_from_single_pair_str
def test_dict_of_key_value_pairs_returns_dict_from_single_pair_str(self):
actual = datatypes.dict_of_key_value_pairs('foo=bar')
expected = {'foo': 'bar'}
self.assertEqual(actual, expected)
示例10: test_dict_of_key_value_pairs_returns_dict_even_if_newlines
def test_dict_of_key_value_pairs_returns_dict_even_if_newlines(self):
actual = datatypes.dict_of_key_value_pairs('foo\n=\nbar\n,\nbaz\n=\nqux')
expected = {'foo': 'bar', 'baz': 'qux'}
self.assertEqual(actual, expected)
示例11: test_handles_empty_inside_quotes
def test_handles_empty_inside_quotes(self):
actual = datatypes.dict_of_key_value_pairs('foo=""')
expected = {'foo': ''}
self.assertEqual(actual, expected)
示例12: test_handles_newlines_inside_quotes
def test_handles_newlines_inside_quotes(self):
actual = datatypes.dict_of_key_value_pairs('foo="a\nb\nc"')
expected = {'foo': 'a\nb\nc'}
self.assertEqual(actual, expected)
示例13: _callFUT
def _callFUT(self, arg):
return datatypes.dict_of_key_value_pairs(arg)
示例14: test_dict_of_key_value_pairs_returns_dict_from_multi_pair_str
def test_dict_of_key_value_pairs_returns_dict_from_multi_pair_str(self):
actual = datatypes.dict_of_key_value_pairs('foo=bar,baz=qux')
expected = {'foo': 'bar', 'baz': 'qux'}
self.assertEqual(actual, expected)
示例15: test_dict_of_key_value_pairs_unicode
def test_dict_of_key_value_pairs_unicode(self):
actual = datatypes.dict_of_key_value_pairs(u'foo=bar,baz=qux')
expected = {'foo': 'bar', 'baz': 'qux'}
self.assertEqual(actual, expected)