cleverhans/devtools/list_files.py

Killed 14 out of 24 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 147

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -3,7 +3,7 @@
 import cleverhans
 
 
-def list_files(suffix=""):
+def list_files(suffix="XXXX"):
   """
   Returns a list of all files in CleverHans with the given suffix.
 

Mutant 150

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -21,7 +21,7 @@
   cleverhans_path = os.path.abspath(cleverhans.__path__[0])
   # In some environments cleverhans_path does not point to a real directory.
   # In such case return empty list.
-  if not os.path.isdir(cleverhans_path):
+  if  os.path.isdir(cleverhans_path):
     return []
   repo_path = os.path.abspath(os.path.join(cleverhans_path, os.pardir))
   file_list = _list_files(cleverhans_path, suffix)

Mutant 153

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -26,7 +26,7 @@
   repo_path = os.path.abspath(os.path.join(cleverhans_path, os.pardir))
   file_list = _list_files(cleverhans_path, suffix)
 
-  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'tests_tf', 'tests_pytorch']
+  extra_dirs = ['XXcleverhans_tutorialsXX', 'examples', 'scripts', 'tests_tf', 'tests_pytorch']
 
   for extra_dir in extra_dirs:
     extra_path = os.path.join(repo_path, extra_dir)

Mutant 154

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -26,7 +26,7 @@
   repo_path = os.path.abspath(os.path.join(cleverhans_path, os.pardir))
   file_list = _list_files(cleverhans_path, suffix)
 
-  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'tests_tf', 'tests_pytorch']
+  extra_dirs = ['cleverhans_tutorials', 'XXexamplesXX', 'scripts', 'tests_tf', 'tests_pytorch']
 
   for extra_dir in extra_dirs:
     extra_path = os.path.join(repo_path, extra_dir)

Mutant 155

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -26,7 +26,7 @@
   repo_path = os.path.abspath(os.path.join(cleverhans_path, os.pardir))
   file_list = _list_files(cleverhans_path, suffix)
 
-  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'tests_tf', 'tests_pytorch']
+  extra_dirs = ['cleverhans_tutorials', 'examples', 'XXscriptsXX', 'tests_tf', 'tests_pytorch']
 
   for extra_dir in extra_dirs:
     extra_path = os.path.join(repo_path, extra_dir)

Mutant 156

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -26,7 +26,7 @@
   repo_path = os.path.abspath(os.path.join(cleverhans_path, os.pardir))
   file_list = _list_files(cleverhans_path, suffix)
 
-  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'tests_tf', 'tests_pytorch']
+  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'XXtests_tfXX', 'tests_pytorch']
 
   for extra_dir in extra_dirs:
     extra_path = os.path.join(repo_path, extra_dir)

Mutant 157

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -26,7 +26,7 @@
   repo_path = os.path.abspath(os.path.join(cleverhans_path, os.pardir))
   file_list = _list_files(cleverhans_path, suffix)
 
-  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'tests_tf', 'tests_pytorch']
+  extra_dirs = ['cleverhans_tutorials', 'examples', 'scripts', 'tests_tf', 'XXtests_pytorchXX']
 
   for extra_dir in extra_dirs:
     extra_path = os.path.join(repo_path, extra_dir)

Mutant 164

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -38,7 +38,7 @@
   return file_list
 
 
-def _list_files(path, suffix=""):
+def _list_files(path, suffix="XXXX"):
   """
   Returns a list of all files ending in `suffix` contained within `path`.
 

Mutant 169

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -65,7 +65,7 @@
         flattened.append(elem)
     return flattened
   else:
-    assert os.path.exists(path), "couldn't find file '%s'" % path
+    assert os.path.exists(path), "XXcouldn't find file '%s'XX" % path
     if path.endswith(suffix):
       return [path]
     return []

Mutant 170

--- cleverhans/devtools/list_files.py
+++ cleverhans/devtools/list_files.py
@@ -65,7 +65,7 @@
         flattened.append(elem)
     return flattened
   else:
-    assert os.path.exists(path), "couldn't find file '%s'" % path
+    assert os.path.exists(path), "couldn't find file '%s'" / path
     if path.endswith(suffix):
       return [path]
     return []