Browse Source

Fixed some syntax errors

Patrick Falls 12 years ago
parent
commit
1a70b9d821
2 changed files with 13 additions and 10 deletions
  1. 2 2
      benchmarker.py
  2. 11 8
      framework_test.py

+ 2 - 2
benchmarker.py

@@ -306,7 +306,7 @@ class Benchmarker:
         continue
         continue
       
       
       # If the test does not contain an implementation of the current test-type, skip it
       # If the test does not contain an implementation of the current test-type, skip it
-      if not test.containsType(self.type):
+      if not test.contains_type(self.type):
         continue
         continue
       
       
       print textwrap.dedent("""
       print textwrap.dedent("""
@@ -544,4 +544,4 @@ class Benchmarker:
   # End __init__
   # End __init__
   ############################################################
   ############################################################
   
   
-  
+  

+ 11 - 8
framework_test.py

@@ -161,14 +161,17 @@ class FrameworkTest:
   # test type (json, db, etc.)
   # test type (json, db, etc.)
   ############################################################
   ############################################################
   def contains_type(self, type):
   def contains_type(self, type):
-    if type == 'json' and self.json_url not None:
-      return True
-    if type == 'db' and self.db_url not None:
-      return True
-    if type == 'query' and self.query_url not None:
-      return True
-    if type == 'fortune' and self.fortune_url not None:
-      return True
+    try:
+      if type == 'json' and self.json_url != None:
+        return True
+      if type == 'db' and self.db_url != None:
+        return True
+      if type == 'query' and self.query_url != None:
+        return True
+      if type == 'fortune' and self.fortune_url != None:
+        return True
+    except AttributeError:
+      pass
       
       
     return False
     return False
   ############################################################
   ############################################################