Skip to content

Commit

Permalink
Improve UnwantedStrings to work correctly with Vim swap files
Browse files Browse the repository at this point in the history
  • Loading branch information
fgeek committed Aug 17, 2019
1 parent 0be26e3 commit 82471cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests.py
Expand Up @@ -57,12 +57,13 @@ def test_search_unwanted_strings(self):
filepath = os.path.join(root, f)
if filepath.endswith('.pyc'):
continue
if filepath.endswith('.swp'):
continue
file = open(filepath, 'r')
for line in file:
if re.search('osvdb', line):
self.fail('OSVDB string found from: %s' % filepath)



class FilePaths(unittest.TestCase):
def test_filepaths(self):
Expand All @@ -89,7 +90,7 @@ def test_detect_general_utf8(self):
def test_detect_withoutnewlines_utf8(self):
"""Detect_general with UTF-8 encoded file."""
res = detect_withoutnewlines('testfiles/UTF-8', '<!ENTITY bz-ver.*?(?P<version>5\.[0-9]+)')

if __name__ == '__main__':

if sys.version_info[0] < 3:
Expand Down

0 comments on commit 82471cd

Please sign in to comment.