コード例 #1
0
ファイル: test_dictstyles.py プロジェクト: vmalloc/pyrefactor
def test_complex_dict():
    for dict_form, curly_form in [
            ("{'f': some_function(2), 'g': a.b.c.d}", "dict(f=some_function(2), g=a.b.c.d)"),
            ]:
        assert toggle_dict_style(dict_form) == curly_form
        assert toggle_dict_style(curly_form) == dict_form
コード例 #2
0
ファイル: test_dictstyles.py プロジェクト: vmalloc/pyrefactor
def test_dict_to_curly():
    assert toggle_dict_style("{'a': 2}") == "dict(a=2)"
コード例 #3
0
ファイル: test_dictstyles.py プロジェクト: vmalloc/pyrefactor
def test_curly_to_dict():
    assert toggle_dict_style("dict(a=2)") == "{'a': 2}"
コード例 #4
0
ファイル: test_dictstyles.py プロジェクト: vmalloc/pyrefactor
def test_errors(invalid_syntax):
    assert toggle_dict_style(invalid_syntax) == invalid_syntax