예제 #1
0
def test_missing_quote_yields_error():
    with pytest.raises(UntreatedError):
        split("'")

    with pytest.raises(UntreatedError):
        split("'''")

    with pytest.raises(UntreatedError):
        split('"')

    with pytest.raises(UntreatedError):
        split('"""')
예제 #2
0
파일: test_spliter.py 프로젝트: PyCQA/baron
def test_missing_quote_yields_error():
    with pytest.raises(UntreatedError):
        split("'")

    with pytest.raises(UntreatedError):
        split("'''")

    with pytest.raises(UntreatedError):
        split('"')

    with pytest.raises(UntreatedError):
        split('"""')
예제 #3
0
def test_multi_string():
    assert split("'''pouet pouet'''") == ["'''pouet pouet'''"]
예제 #4
0
def test_call():
    assert split("function()") == ["function", "(", ")"]
예제 #5
0
def test_empty():
    assert split("") == []
예제 #6
0
def test_comma_with_words():
    assert split("a, b") == ["a", ",", " ", "b"]
예제 #7
0
def test_several_spaces():
    assert split("     ") == ["     "]
예제 #8
0
 def test_remove_crap():
     assert split("\x0c\xef\xbb\xbf") == []
예제 #9
0
def test_multi_string_with_same_quotes_in():
    assert split('"""pouet " "" pouet"""') == ['"""pouet " "" pouet"""']
예제 #10
0
def test_hexa():
    assert split("0x7F") == ["0x7F"]
예제 #11
0
def test_other_escape_string():
    assert split("'\\\\'") == ["'\\\\'"]
예제 #12
0
def test_underscore_variable():
    assert split("some_variable") == ["some_variable"]
예제 #13
0
def test_escape_in_string():
    assert split("'\\\\'") == ["'\\\\'"]
예제 #14
0
def test_escape():
    assert split("\\\\") == ["\\", "\\"]
예제 #15
0
def test_multi_string_other_quotes():
    assert split('"""pouet pouet"""') == ['"""pouet pouet"""']
예제 #16
0
def test_escape():
    assert split("\\\\") == ["\\", "\\"]
예제 #17
0
def test_other_escape_string():
    assert split("'\\\\'") == ["'\\\\'"]
예제 #18
0
def test_multi_string_with_same_quotes_in():
    assert split('"""pouet " "" pouet"""') == ['"""pouet " "" pouet"""']
예제 #19
0
def test_backslash_in_comment():
    assert split("# pouet \\t pouet\npouet") == ["# pouet \\t pouet", "\n", "pouet"]
예제 #20
0
def test_comment_backslash():
    assert split('# pouet \\\npouet') == ["# pouet \\", "\n", "pouet"]
예제 #21
0
def test_decorator():
    assert split("@pouet") == ["@", "pouet"]
예제 #22
0
def test_backslash_in_comment():
    assert split("# pouet \\t pouet\npouet") == [
        "# pouet \\t pouet", "\n", "pouet"
    ]
예제 #23
0
def test_several_numbers():
    assert split("12 34") == ["12", " ", "34"]
예제 #24
0
def test_regression():
    assert split("(r'[\"\\'](.|\n|\r)*[\"\\']', 'STRING'),") == [
        "(", "r", "'[\"\\'](.|\n|\r)*[\"\\']'", ",", " ", "'STRING'", ")", ","
    ]
예제 #25
0
def test_dot_with_word():
    assert split("a.b") == ["a", ".", "b"]
예제 #26
0
 def test_remove_crap():
     assert split("\x0c\xef\xbb\xbf") == []
예제 #27
0
def test_colon_word():
    assert split("pouet;") == ["pouet", ";"]
예제 #28
0
def test_different_case():
    assert split("AbCd cDeF") == ["AbCd", " ", "cDeF"]
예제 #29
0
파일: test_grouper.py 프로젝트: PyCQA/baron
def grouper_test(input, split_output, group_output):
    assert split(input) == split_output
    assert group(split_output) == group_output
예제 #30
0
def test_decorator():
    assert split("@pouet") == ["@", "pouet"]
예제 #31
0
def test_underscore_variable():
    assert split("some_variable") == ["some_variable"]
예제 #32
0
def test_tab_n_space():
    assert split("	 ") == ["	 "]
예제 #33
0
def test_escape_in_string():
    assert split("'\\\\'") == ["'\\\\'"]
예제 #34
0
def test_several_spaces():
    assert split("     ") == ["     "]
예제 #35
0
def test_hexa():
    assert split("0x7F") == ["0x7F"]
예제 #36
0
def test_numbers():
    assert split("1234") == ["1234"]
예제 #37
0
def test_comment_backslash():
    assert split('# pouet \\\npouet') == ["# pouet \\", "\n", "pouet"]
예제 #38
0
def test_several_numbers():
    assert split("12 34") == ["12", " ", "34"]
예제 #39
0
def test_regression():
    assert split("(r'[\"\\'](.|\n|\r)*[\"\\']', 'STRING'),") == ["(", "r", "'[\"\\'](.|\n|\r)*[\"\\']'", ",", " ", "'STRING'", ")", ","]
예제 #40
0
def test_comma():
    assert split(",") == [","]
예제 #41
0
def test_different_case():
    assert split("AbCd cDeF") == ["AbCd", " ", "cDeF"]
예제 #42
0
def test_comma_with_words():
    assert split("a, b") == ["a", ",", " ", "b"]
예제 #43
0
def test_tab_n_space():
    assert split("	 ") == ["	 "]
예제 #44
0
def test_dot():
    assert split(".") == ["."]
예제 #45
0
def test_numbers():
    assert split("1234") == ["1234"]
예제 #46
0
def test_dot_with_word():
    assert split("a.b") == ["a", ".", "b"]
예제 #47
0
def test_comma():
    assert split(",") == [","]
예제 #48
0
def test_dot_with_words():
    assert split("a.b.c") == ["a", ".", "b", ".", "c"]
예제 #49
0
def test_dot():
    assert split(".") == ["."]
예제 #50
0
def test_colon():
    assert split(";") == [";"]
예제 #51
0
def test_dot_with_words():
    assert split("a.b.c") == ["a", ".", "b", ".", "c"]
예제 #52
0
def test_colon_word():
    assert split("pouet;") == ["pouet", ";"]
예제 #53
0
def test_colon():
    assert split(";") == [";"]
예제 #54
0
def test_empty():
    assert split("") == []
예제 #55
0
def test_assign():
    assert split("a = b") == ["a", " ", "=", " ", "b"]
예제 #56
0
def test_assign():
    assert split("a = b") == ["a", " ", "=", " ", "b"]
예제 #57
0
def test_call_with_arg():
    assert split("function(a)") == ["function", "(", "a", ")"]
예제 #58
0
 def test_assign_unicode():
     assert split("α = β") == ["α", " ", "=", " ", "β"]
예제 #59
0
def grouper_test(input, split_output, group_output):
    assert split(input) == split_output
    assert group(split_output) == group_output
예제 #60
0
def test_multi_string_other_quotes():
    assert split('"""pouet pouet"""') == ['"""pouet pouet"""']