in testinggame/__init__.py [0:0]
def _find_python_tests(blame_lines, names, source):
"""
Finds the number of python test cases per user.
Args:
blame_lines: An array where each index is a string containing the git
blame line.
names: The current dictionary containing the usernames as a key and the
number of tests as a value.
Returns:
A dictionary built off the names argument containing the usernames as a
key and the number of tests as a value.
"""
for blame_line in blame_lines:
separator = blame_line.find(')')
blame_code_nospaces = blame_line[separator+1:]
blame_code_nospaces = blame_code_nospaces.replace(' ', '')
blame_code_nospaces = blame_code_nospaces.replace('\t', '')
if blame_code_nospaces.startswith('deftest'):
name = _find_name_from_blame(blame_line)
name_count = names.get(name, 0)
names[name] = name_count + 1
return names