Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b6313dd

Browse files
committed
Python: Add concept tests
1 parent 8350d64 commit b6313dd

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
open("filepath") # $getAPathArgument="filepath"
2+
open(file="filepath") # $getAPathArgument="filepath"
3+
4+
o = open
5+
6+
o("filepath") # f-:$getAPathArgument="filepath"
7+
o(file="filepath") # f-:$getAPathArgument="filepath"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os.path
2+
3+
path = "un\\normalized/path"
4+
5+
p1 = os.path.normpath(path) # $pathNormalization
6+
p2 = os.path.normpath(path=path) # $pathNormalization
7+
8+
np = os.path.normpath
9+
10+
p3 = np(path) # $pathNormalization
11+
p4 = np(path=path) # $pathNormalization
12+
13+
14+
def normalize(path):
15+
return os.path.normpath(path) # $pathNormalization
16+
17+
18+
p5 = normalize(path)
19+
p6 = normalize(path=path)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
s = "taintedString"
2+
3+
if s.startswith("tainted"): # $checks=s $branch=true
4+
pass

0 commit comments

Comments
 (0)