Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
test coverage all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Pai-Wei Lai committed Aug 30, 2016
1 parent be3568b commit 1598542
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 9 additions & 0 deletions tests/examples/dbl_quote_docstring_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ def derp():
def derp():
"""doc"""
''')


def test_no_change():
patterns = get_patterns(dbl_quote_docstring)
text = """
def derp():
'''inside\"\"\"str'''
"""
assert process(patterns, text) == (text)
8 changes: 3 additions & 5 deletions undebt/examples/remove_unused_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
@tokens_as_list(assert_len=1)
def replace(original, location, tokens):
header, original_without_header = tokens[0], original[len(tokens[0]):]
if "function" in original_without_header:
return None
elif "from function_lives_here import function\n" in header:
if "function" not in original_without_header and "from function_lives_here import function\n" in header:
return header.replace("from function_lives_here import function\n", "")
else:
return None

return None

0 comments on commit 1598542

Please sign in to comment.