Example #1
0
 def test_sh_quote__simple_quote():
     teststring = "a b c"
     result = Gitget._sh_quote(teststring)
     assert result == f"'{teststring}'"
Example #2
0
 def test_sh_quote__command_injection():
     teststring = "'; ls /; echo"
     result = Gitget._sh_quote(teststring)
     assert result == "''\"'\"'; ls /; echo'"
Example #3
0
 def test_sh_quote__integer():
     teststring = 1234
     result = Gitget._sh_quote(teststring)
     assert result == f"{teststring}"
Example #4
0
 def test_sh_quote__no_quote():
     teststring = "abc"
     result = Gitget._sh_quote(teststring)
     assert result == f"{teststring}"
Example #5
0
 def test_HEAD_invalid():
     teststring = "HEAD~ invalid"
     result = Gitget._sh_quote(teststring)
     assert result == f"'{teststring}'"
Example #6
0
 def test_HEAD_no_int():
     teststring = "HEAD~no_int"
     result = Gitget._sh_quote(teststring)
     assert result == f"'{teststring}'"
Example #7
0
 def test_HEAD_int():
     teststring = "HEAD~10"
     result = Gitget._sh_quote(teststring)
     assert result == teststring