root/trunk/djangoid/runtests.py
| Revision 23, 1.5 kB (checked in by nicolast, 5 years ago) |
|---|
| Line | |
|---|---|
| 1 | #Djangoid - Django-based OpenID server/provider |
| 2 | #Copyright (C) 2006 Nicolas Trangez <ikke nicolast be> |
| 3 | # |
| 4 | #This program is free software; you can redistribute it and/or modify |
| 5 | #it under the terms of the GNU General Public License as published by |
| 6 | #the Free Software Foundation; either version 2 of the License. |
| 7 | # |
| 8 | #This program is distributed in the hope that it will be useful, |
| 9 | #but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | #GNU General Public License for more details. |
| 12 | # |
| 13 | #You should have received a copy of the GNU General Public License |
| 14 | #along with this program; if not, write to the Free Software |
| 15 | #Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 16 | # |
| 17 | #EOL |
| 18 | #!/usr/bin/env python |
| 19 | import doctest, sys, os |
| 20 | sys.path.append("../") |
| 21 | os.environ["DJANGO_SETTINGS_MODULE"] = "djangoid.settings" |
| 22 | |
| 23 | import microidutils |
| 24 | import openidhandlers |
| 25 | import users.models |
| 26 | |
| 27 | mods = ( |
| 28 | microidutils, |
| 29 | openidhandlers, |
| 30 | users.models |
| 31 | ) |
| 32 | |
| 33 | def run_tests(): |
| 34 | verbose = "-v" in sys.argv |
| 35 | for mod in mods: |
| 36 | print "=== Testing %s ===" % mod.__name__ |
| 37 | (fails, tests) = doctest.testmod(mod, verbose = verbose, report = 0) |
| 38 | print ">>> %d tests run, %d failed" % (tests, fails) |
| 39 | |
| 40 | |
| 41 | print "=== Summary ===" |
| 42 | doctest.master.summarize(verbose) |
| 43 | |
| 44 | if __name__ == "__main__": |
| 45 | run_tests() |
Note: See TracBrowser for help on using the browser.
