MCPcopy Create free account
hub / github.com/apache/cloudstack / __checkImport

Method __checkImport

tools/marvin/marvin/marvinPlugin.py:135–155  ·  view source on GitHub ↗

@Name : __checkImport @Desc : Verifies to run the available test module for any Import Errors before running and check whether if it is importable. This will check for test modules which has some issues to be getting im

(self, filename)

Source from the content-addressed store, hash-verified

133 return None
134
135 def __checkImport(self, filename):
136 '''
137 @Name : __checkImport
138 @Desc : Verifies to run the available test module for any Import
139 Errors before running and check
140 whether if it is importable.
141 This will check for test modules which has some issues to be
142 getting imported.
143 Returns False or True based upon the result.
144 '''
145 try:
146 if os.path.isfile(filename):
147 ret = os.path.splitext(filename)
148 if ret[1] == ".py":
149 os.system("python " + filename)
150 return True
151 return False
152 except ImportError as e:
153 print("FileName :%s : Error : %s" % \
154 (filename, GetDetailExceptionInfo(e)))
155 return False
156
157 def wantFile(self, filename):
158 '''

Callers 1

wantFileMethod · 0.95

Calls 1

GetDetailExceptionInfoFunction · 0.90

Tested by

no test coverage detected