Permalink
Browse files

Add note about nosetests and commit the framework.

  • Loading branch information...
mricon committed Mar 12, 2012
1 parent 2cfb041 commit f355f36a98f597f8f5affa483f192358b788b960
View
@@ -1,3 +1,8 @@
+0.4.1-current
+-------------
+- Add nosetests framework. To run:
+ nosetests -w tests/
+
0.4.0
-----
- Replace --do-not-nag with --do-not-nag-until
@@ -0,0 +1,11 @@
+; $Id: system.info,v 1.3 2006/11/21 20:55:35 dries Exp $
+name = System
+description = Handles general site configuration for administrators.
+package = Core - required
+version = VERSION
+
+; Information added by drupal.org packaging script on 2008-01-29
+version = "5.7"
+project = "drupal"
+datestamp = "1201565404"
+
@@ -0,0 +1,4 @@
+name = "Admin:hover"
+description = "Displays admin links on hover."
+package = "Administration"
+core = 6.x
@@ -0,0 +1,13 @@
+name = CDN
+description = "Integrates your site with a CDN, through altering file URLs."
+
+core = 6.x
+package = Performance and scalability
+dependencies[] = ctools
+
+; Information added by drupal.org packaging script on 2012-02-15
+version = "6.x-2.2"
+core = "6.x"
+project = "cdn"
+datestamp = "1329338739"
+
@@ -0,0 +1,11 @@
+name = "Certificate Login"
+description = "Allow users to login/register by certificate"
+core = 6.x
+php =4
+
+; Information added by drupal.org packaging script on 2011-10-11
+version = "6.x-2.2"
+core = "6.x"
+project = "certificatelogin"
+datestamp = "1318364500"
+
@@ -0,0 +1,9 @@
+name = Cool Aid
+description = Provides a user-submitted per-page custom help message (or button for pop-up help).
+core = 6.x
+; Information added by drupal.org packaging script on 2012-01-26
+version = "6.x-1.6"
+core = "6.x"
+project = "coolaid"
+datestamp = "1327545344"
+
@@ -0,0 +1,12 @@
+name = Cumulus
+description = "Provides a Flash-based 3D tag cloud."
+core = 6.x
+dependencies[] = tagadelic
+package = "Taxonomy"
+
+; Information added by drupal.org packaging script on 2011-10-10
+version = "6.x-1.4"
+core = "6.x"
+project = "cumulus"
+datestamp = "1318232504"
+
@@ -0,0 +1,11 @@
+name = Date API
+description = A Date API that can be used by other modules.
+package = Date/Time
+core = 6.x
+
+; Information added by drupal.org packaging script on 2012-01-11
+version = "6.x-2.6"
+core = "6.x"
+project = "date"
+datestamp = "1326285938"
+
@@ -0,0 +1,19 @@
+name = System
+description = Handles general site configuration for administrators.
+package = Core
+version = VERSION
+core = 7.x
+files[] = system.archiver.inc
+files[] = system.mail.inc
+files[] = system.queue.inc
+files[] = system.tar.inc
+files[] = system.updater.inc
+files[] = system.test
+required = TRUE
+configure = admin/config/system
+
+; Information added by drupal.org packaging script on 2011-12-05
+version = "7.10"
+project = "drupal"
+datestamp = "1323125439"
+
View
@@ -0,0 +1,30 @@
+;
+; Drupal core
+;
+[Drupal Core 7]
+failver = 7.10
+
+[Drupal Core 6]
+failver = 6.11
+
+[Drupal Core 5]
+failver = 5.7
+
+[Drupal 6.x: Admin:hover Module]
+failver = any
+
+[Drupal 6.x: CDN Module]
+failver = 2.2
+
+[Drupal 6.x: Certificate Login Module]
+failver = 2.2
+
+[Drupal 6.x: Cool Aid Module]
+failver = 1.6
+
+[Drupal 6.x: Cumulus Module]
+failver = 1.4
+
+[Drupal 6.x: Date Module]
+failver = 2.6
+
View
@@ -0,0 +1,64 @@
+#!/usr/bin/python -tt
+##
+# Copyright (C) 2012 by Konstantin Ryabitsev and contributors
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+from ConfigParser import ConfigParser, NoSectionError
+import sys
+
+sys.path.insert(0, '../')
+
+import crudminer
+
+TESTDIR = '.'
+CRUDFILE = '../crud.ini'
+
+def compare_results(want, results):
+ assert want in results, '"%s" not found in results' % want
+
+def check_sections(crudsec, testsecs):
+ assert crudsec in testsecs, 'section "%s" not found in test.ini' % crudsec
+
+def test_crud():
+ report = crudminer.analyze_dir(TESTDIR, CRUDFILE, True)
+
+ results = []
+ for (path, crudp, state, foundver) in report:
+ results.append((crudp.name, crudp.secure, state, foundver))
+
+ crudcfg = ConfigParser()
+ crudcfg.read(CRUDFILE)
+
+ testcfg = ConfigParser()
+ testcfg.read(TESTDIR + '/test.ini')
+
+ for section in crudcfg.sections():
+ yield check_sections, section, testcfg.sections()
+
+ if section not in testcfg.sections():
+ continue
+
+ secure = crudcfg.get(section, 'secure')
+ failver = testcfg.get(section, 'failver')
+
+ testlist = (section, secure, 'vulnerable', failver)
+
+ yield compare_results, testlist, results
+
+ # pop it from the result, so matches are faster
+ results.remove(testlist)
+

0 comments on commit f355f36

Please sign in to comment.