[asterisk-commits] kpfleming: testsuite/asterisk/trunk r3148 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 23 17:44:04 CDT 2012


Author: kpfleming
Date: Fri Mar 23 17:44:02 2012
New Revision: 3148

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3148
Log:
Fix up some comments and start adding unit tests.


Modified:
    asterisk/trunk/lib/python/asterisk/buildoptions.py

Modified: asterisk/trunk/lib/python/asterisk/buildoptions.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/buildoptions.py?view=diff&rev=3148&r1=3147&r2=3148
==============================================================================
--- asterisk/trunk/lib/python/asterisk/buildoptions.py (original)
+++ asterisk/trunk/lib/python/asterisk/buildoptions.py Fri Mar 23 17:44:02 2012
@@ -1,11 +1,11 @@
 #!/usr/bin/env python
-"""Asterisk Version String Handling
+"""Asterisk Build Options Handling
 
-This module implements an Asterisk compilation flag parser.  It
-tracks what compiler flags Asterisk was compiled with, and returns
-whether or not a particular compiler flag is supported.
+This module implements an Asterisk build options parser.  It
+tracks what build options Asterisk was compiled with, and returns
+whether or not a particular build option was enabled.
 
-Copyright (C) 2011, Digium, Inc.
+Copyright (C) 2011-2012, Digium, Inc.
 Matt Jordan <mjordan at digium.com>
 
 This program is free software, distributed under the terms of
@@ -40,7 +40,8 @@
             buildopts_hdr_paths.insert(0, path)
         for p in buildopts_hdr_paths:
             if (self.__parse_buildopts_file(p)):
-                break
+                return
+        print "Failed to open any build options files"
 
 
     def __parse_buildopts_file(self, path):
@@ -50,7 +51,6 @@
             fileLines = f.readlines()
             f.close()
         except IOError:
-            print "Failed to open config file '%s'" % path
             return retVal
         except:
             print "Unexpected error: %s" % sys.exc_info()[0]
@@ -85,3 +85,15 @@
             return True
         return False
 
+class AsteriskBuildOptionsTests(unittest.TestCase):
+    def test_1(self):
+        b1 = AsteriskBuildOptions()
+        self.assertTrue(1)
+
+
+def main():
+    unittest.main()
+
+
+if __name__ == "__main__":
+    main()




More information about the asterisk-commits mailing list