[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] refactor for extensibility, easier to exclude file formats from check for



commit 9a267690af2d6480753bfc794a5a7be2a89e7803
Author: Chelsea H. Komlo <chelsea.komlo@xxxxxxxxx>
Date:   Tue Nov 1 08:09:51 2016 -0500

    refactor for extensibility, easier to exclude file formats from check for
    required files
---
 test/integ/installation.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/integ/installation.py b/test/integ/installation.py
index e830446..533aefd 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -81,9 +81,10 @@ class TestInstallation(unittest.TestCase):
 
     for root, dirnames, filenames in os.walk(os.path.join(BASE_DIRECTORY, 'stem')):
       for filename in filenames:
-        if (not filename.endswith('.pyc') and not filename.endswith('.swp') and
-            not filename.endswith('.swo')):
-          expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 1:])
+          file_format = filename.split('.')[-1]
+          excluded = ['pyc', 'swp', 'swo']
+          if not file_format in excluded:
+            expected.add(os.path.join(root, filename)[len(BASE_DIRECTORY) + 1:])
 
     for root, dirnames, filenames in os.walk(self.site_packages_path):
       for filename in filenames:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits