Fix unit tests problem for Python
This commit is contained in:
parent
71b532710f
commit
f9fa72b9db
@ -1,27 +1,3 @@
|
|||||||
INPUT_FILE_NAME = "example.txt"
|
|
||||||
|
|
||||||
class SampleClassBad (object):
|
|
||||||
# WrongClassName: this will appear in the function list
|
|
||||||
|
|
||||||
def __init__ (self, fileName):
|
|
||||||
self.fileName = fileName
|
|
||||||
|
|
||||||
|
|
||||||
class SampleClassGood(object):
|
|
||||||
# this works as expected: notice the missing space between
|
|
||||||
# the class name and the left parenthesis.
|
|
||||||
|
|
||||||
def __init__ (self, fileName):
|
|
||||||
self.fileName = fileName
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
sampleBad = SampleClassBad (INPUT_FILE_NAME)
|
|
||||||
sampleGood = SampleClassGood (INPUT_FILE_NAME)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
@ -305,3 +281,25 @@ def krusk(E_and_n):
|
|||||||
s[j].update(s[i])
|
s[j].update(s[i])
|
||||||
s.pop(i)
|
s.pop(i)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
INPUT_FILE_NAME = "example.txt"
|
||||||
|
|
||||||
|
class SampleClassBad (object):
|
||||||
|
# WrongClassName: this will appear in the function list
|
||||||
|
|
||||||
|
def __init__ (self, fileName):
|
||||||
|
self.fileName = fileName
|
||||||
|
|
||||||
|
|
||||||
|
class SampleClassGood(object):
|
||||||
|
# this works as expected: notice the missing space between
|
||||||
|
# the class name and the left parenthesis.
|
||||||
|
|
||||||
|
def __init__ (self, fileName):
|
||||||
|
self.fileName = fileName
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
{"leaves":["main()","dfs(G, s)","bfs(G, s)","dijk(G, s)","topo(G, ind=None, Q=[1])","adjm()","floy(A_and_n)","prim(G, s)","edglist()","krusk(E_and_n)"],"nodes":[{"leaves":["__init__ (self, fileName)"],"name":"SampleClassBad"},{"leaves":["__init__ (self, fileName)"],"name":"SampleClassGood"}],"root":"unitTest"}
|
{"leaves":["dfs(G, s)","bfs(G, s)","dijk(G, s)","topo(G, ind=None, Q=[1])","adjm()","floy(A_and_n)","prim(G, s)","edglist()","krusk(E_and_n)"],"nodes":[{"leaves":["__init__ (self, fileName)"],"name":"SampleClassBad"},{"leaves":["__init__ (self, fileName)"],"name":"SampleClassGood"}],"root":"unitTest"}
|
Loading…
Reference in New Issue
Block a user