[cc-commits] [CC SVN] r12017 - in api/trunk: . docs relax tests
webmaster at creativecommons.org
webmaster at creativecommons.org
Thu Apr 2 12:59:16 EDT 2009
Author: nyergler
Date: 2009-04-02 16:59:15 +0000 (Thu, 02 Apr 2009)
New Revision: 12017
Added:
api/trunk/tests/
api/trunk/tests/__init__.py
Removed:
api/trunk/cc_rest/
api/trunk/relax/classes.relax.xml
api/trunk/relax/error.relax.xml
api/trunk/relax/issue.relax.xml
api/trunk/relax/licenseclass.relax.xml
api/trunk/relax/locales.relax.xml
api/trunk/soap/
api/trunk/tests/
api/trunk/tests/__init__.py
Modified:
api/trunk/
api/trunk/buildout.cfg
api/trunk/docs/TODO.txt
api/trunk/rest_api.py
api/trunk/setup.py
api/trunk/simplechooser.py
Log:
Merged revisions 10186,10192,10194-10195,10203-10205,10210,10226,10229-10231,10233,10235-10237,10239-10241,10246-10247,10249-10250,10255-10258,10267,10270-10271,10274-10276,10278-10285,10288,10295-10299,10310,10312,10315-10316,10322-10325,10328,10331-10332,10339,10341-10343,10345,10351 via svnmerge from
svn+ssh://svn@code.creativecommons.org/svnroot/api/branches/nose-test-suite-branch
........
r10186 | frank | 2008-06-19 17:09:17 -0700 (Thu, 19 Jun 2008) | 1 line
stub addition of parallel nose-test framework/harness, with some modifications to buildout config
........
r10192 | frank | 2008-06-20 10:15:30 -0700 (Fri, 20 Jun 2008) | 1 line
add setup.py dependencies, and include an entry-point to appease webtest.TestApp (thanks NY)
........
r10194 | frank | 2008-06-20 10:30:01 -0700 (Fri, 20 Jun 2008) | 1 line
port r10193: delete cc.api.egg-info
........
r10195 | frank | 2008-06-20 11:15:38 -0700 (Fri, 20 Jun 2008) | 1 line
Get trivial tests using the test server, and update TODO.txt
........
r10203 | frank | 2008-06-20 15:12:25 -0700 (Fri, 20 Jun 2008) | 1 line
begin porting tests
........
r10204 | frank | 2008-06-20 15:24:04 -0700 (Fri, 20 Jun 2008) | 1 line
ported more tests
........
r10205 | frank | 2008-06-20 15:28:12 -0700 (Fri, 20 Jun 2008) | 1 line
rename test_test.py to something less redundant
........
r10210 | frank | 2008-06-20 16:18:04 -0700 (Fri, 20 Jun 2008) | 1 line
a bunch more ports. one recent test fails (apparently legitimately), and must be fixed.
........
r10226 | frank | 2008-06-23 11:50:25 -0700 (Mon, 23 Jun 2008) | 1 line
Fix one index.relax.xml issue, which leads to another
........
r10229 | frank | 2008-06-23 13:22:17 -0700 (Mon, 23 Jun 2008) | 1 line
Port testGet and associated helper functions. test_get fails for the same reason as test_issue.
........
r10230 | frank | 2008-06-23 13:36:56 -0700 (Mon, 23 Jun 2008) | 1 line
minor: update TODO items
........
r10231 | frank | 2008-06-23 13:41:05 -0700 (Mon, 23 Jun 2008) | 1 line
rename new test suite to facilitate importing the module (a 'test' module already exists in python).
........
r10233 | frank | 2008-06-23 14:28:27 -0700 (Mon, 23 Jun 2008) | 1 line
ported testGetExtraArgs as test_get_extra_args; same failure as the last two, regarding issue.relax.xml
........
r10235 | frank | 2008-06-23 14:54:29 -0700 (Mon, 23 Jun 2008) | 1 line
port three more tests: test_issue_error, test_issue_invalid_class, test_get_invalid_class
........
r10236 | frank | 2008-06-23 14:59:00 -0700 (Mon, 23 Jun 2008) | 1 line
part one of a renaming scheme to make importing the new test module easier
........
r10237 | frank | 2008-06-23 15:01:23 -0700 (Mon, 23 Jun 2008) | 1 line
part 2: new naming scheme complete
........
r10239 | frank | 2008-06-23 15:46:28 -0700 (Mon, 23 Jun 2008) | 1 line
Port testDetailsError as test_details_error
........
r10240 | frank | 2008-06-23 16:08:26 -0700 (Mon, 23 Jun 2008) | 1 line
fix the issue.relax.xml issue (thanks to nathan) and update TODO.txt
........
r10241 | frank | 2008-06-23 16:10:13 -0700 (Mon, 23 Jun 2008) | 1 line
add tests/__init__.py to facilitate importing the test modules
........
r10246 | frank | 2008-06-23 17:00:44 -0700 (Mon, 23 Jun 2008) | 1 line
port xml tests; do a bit of refactoring to create tests/test_common.py; single test fails, on account of questions.relax.xml; update docs/TODO.txt accordingly
........
r10247 | frank | 2008-06-23 17:01:36 -0700 (Mon, 23 Jun 2008) | 1 line
forgot to add some test files in the last commit
........
r10249 | frank | 2008-06-24 09:33:22 -0700 (Tue, 24 Jun 2008) | 1 line
On second inspection, the tests in test_xml.py are irrelevent because license_xsl is deprecated.
........
r10250 | frank | 2008-06-24 09:40:18 -0700 (Tue, 24 Jun 2008) | 1 line
refactor relax_validate function into the test_common module.
........
r10255 | frank | 2008-06-24 13:21:05 -0700 (Tue, 24 Jun 2008) | 1 line
test data is now canned instead of pulling that data from the api; more to come
........
r10256 | frank | 2008-06-24 13:28:20 -0700 (Tue, 24 Jun 2008) | 1 line
add config option to suppress annoying cherrypy output.
........
r10257 | frank | 2008-06-24 13:42:37 -0700 (Tue, 24 Jun 2008) | 1 line
add teardown fixture that stops the server, to avoid annoying warnings.
........
r10258 | frank | 2008-06-24 14:14:42 -0700 (Tue, 24 Jun 2008) | 1 line
port last remaining tests, and update docs/TODO.txt accordingly
........
r10267 | frank | 2008-06-24 17:29:59 -0700 (Tue, 24 Jun 2008) | 1 line
add some more canned data to the tests, and move the relax validation files currently being used into a new directory under 'tests'
........
r10270 | frank | 2008-06-24 18:06:58 -0700 (Tue, 24 Jun 2008) | 1 line
utilize the __all__ property for smart exporting
........
r10271 | frank | 2008-06-24 19:20:09 -0700 (Tue, 24 Jun 2008) | 1 line
begin to class-ify the tests; cheat using unittest, but complain about it later.
........
r10274 | frank | 2008-06-25 09:12:09 -0700 (Wed, 25 Jun 2008) | 1 line
Get TestApi base class (fixtures) working without having to derive from unittest.TestCase; it was easier than the nosetest docs made it seem.
........
r10275 | frank | 2008-06-25 09:21:32 -0700 (Wed, 25 Jun 2008) | 1 line
Delete old tests which have outlived their usefulness
........
r10276 | frank | 2008-06-25 09:54:20 -0700 (Wed, 25 Jun 2008) | 1 line
Add doc strings to TestApi and relax_validate.
........
r10278 | frank | 2008-06-25 11:01:17 -0700 (Wed, 25 Jun 2008) | 1 line
pull test data generation functions into self-contained class with relatively clean interface.
........
r10279 | frank | 2008-06-25 11:44:50 -0700 (Wed, 25 Jun 2008) | 1 line
split locale tests into separate class and module. formatting fixes across the board.
........
r10280 | frank | 2008-06-25 12:01:36 -0700 (Wed, 25 Jun 2008) | 1 line
split details tests into separate class and module.
........
r10281 | frank | 2008-06-25 13:41:50 -0700 (Wed, 25 Jun 2008) | 1 line
split root tests into separate class and module.
........
r10282 | frank | 2008-06-25 14:04:36 -0700 (Wed, 25 Jun 2008) | 1 line
split remaining passing tests into test_license.py. remove all unneeded code from test_all.py; all that's left is the failing tests.
........
r10283 | frank | 2008-06-25 14:39:58 -0700 (Wed, 25 Jun 2008) | 1 line
split all remaining (failing) tests into test_license.py; update and fix test_common.py accordingly.
........
r10284 | frank | 2008-06-25 14:40:54 -0700 (Wed, 25 Jun 2008) | 1 line
delete test_all.py: its services are no longer required.
........
r10285 | frank | 2008-06-25 14:55:01 -0700 (Wed, 25 Jun 2008) | 1 line
make test_common.py more adaptable in finding the server configuration file.
........
r10288 | frank | 2008-06-25 15:40:08 -0700 (Wed, 25 Jun 2008) | 1 line
apparently Quixote is a dependency of rest_api.py
........
r10295 | frank | 2008-06-26 10:15:07 -0700 (Thu, 26 Jun 2008) | 1 line
minor fixes
........
r10296 | frank | 2008-06-26 10:24:49 -0700 (Thu, 26 Jun 2008) | 1 line
split failing tests into their component pieces to further investigate the problem.
........
r10297 | frank | 2008-06-26 10:51:04 -0700 (Thu, 26 Jun 2008) | 1 line
rename some test methods; test some error conditions of /issue for publicdomain and recombo classes; make _field_enums not return some answers given certain classes (e.g. public domain licenses shouldn't have restrictions)
........
r10298 | frank | 2008-06-26 11:15:34 -0700 (Thu, 26 Jun 2008) | 1 line
add 'subClass' element to issue.relax.xml schema; hooray, now all tests pass.
........
r10299 | frank | 2008-06-26 11:28:51 -0700 (Thu, 26 Jun 2008) | 1 line
include 'coverage' dependency for nose's --with-coverage plugin to work.
........
r10310 | frank | 2008-06-26 14:52:22 -0700 (Thu, 26 Jun 2008) | 1 line
refactor the parameter generation code in test_common.py, and deterministically thin out the number of answer strings that get generated.
........
r10312 | frank | 2008-06-26 14:58:18 -0700 (Thu, 26 Jun 2008) | 1 line
remove testcruft from setup.py
........
r10315 | frank | 2008-06-26 16:57:28 -0700 (Thu, 26 Jun 2008) | 1 line
add preliminary testing for /simple/chooser, and get rid of the annoying debug reporting that wasn't being caught.
........
r10316 | frank | 2008-06-26 17:16:48 -0700 (Thu, 26 Jun 2008) | 1 line
parse validity of /simple/chooser with shiny new RelaxNG schema.
........
r10322 | frank | 2008-06-27 10:26:18 -0700 (Fri, 27 Jun 2008) | 1 line
add preliminary testing of /support/jurisdictions, which is very similar to /simple/chooser. and refactor a bit.
........
r10323 | frank | 2008-06-27 10:27:47 -0700 (Fri, 27 Jun 2008) | 1 line
remove lots of cruft.
........
r10324 | frank | 2008-06-27 11:15:17 -0700 (Fri, 27 Jun 2008) | 1 line
minor fixes: formatting, internal interfacing, TODO
........
r10325 | frank | 2008-06-27 11:21:06 -0700 (Fri, 27 Jun 2008) | 1 line
finish testing available license classes against spec.
........
r10328 | frank | 2008-06-27 13:42:39 -0700 (Fri, 27 Jun 2008) | 1 line
/issue should use POST and not GET; add some locale testing for /issue.
........
r10331 | frank | 2008-06-27 14:02:21 -0700 (Fri, 27 Jun 2008) | 1 line
test GET and POST return the same xml for /license.
........
r10332 | frank | 2008-06-27 14:15:58 -0700 (Fri, 27 Jun 2008) | 1 line
refactor and more tests for /details
........
r10339 | frank | 2008-06-30 10:22:48 -0700 (Mon, 30 Jun 2008) | 1 line
add tests for invalid parameters.
........
r10341 | frank | 2008-06-30 10:33:29 -0700 (Mon, 30 Jun 2008) | 1 line
refactor test_support.py and test_simple.py; add tests for extra arguments
........
r10342 | frank | 2008-06-30 10:45:39 -0700 (Mon, 30 Jun 2008) | 1 line
test_simple.py: add tests for jurisdiction, locale, and select; note server error for locale call.
........
r10343 | frank | 2008-06-30 10:48:32 -0700 (Mon, 30 Jun 2008) | 1 line
test_simple.py: unknown locale defaults to english.
........
r10345 | frank | 2008-06-30 10:55:49 -0700 (Mon, 30 Jun 2008) | 1 line
finish adding tests to test_support.py
........
r10351 | frank | 2008-06-30 11:39:53 -0700 (Mon, 30 Jun 2008) | 1 line
add coverage entry point as a work-around for the fact that ./bin/nosetests --with-coverage is broken.
........
Property changes on: api/trunk
___________________________________________________________________
Modified: svnmerge-integrated
- /api/branches/nose-test-suite-branch:1-10185
+ /api/branches/nose-test-suite-branch:1-12015
Modified: api/trunk/buildout.cfg
===================================================================
--- api/trunk/buildout.cfg 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/buildout.cfg 2009-04-02 16:59:15 UTC (rev 12017)
@@ -6,5 +6,7 @@
[cc.api]
recipe = zc.recipe.egg
eggs = cc.api
-entry-points = zdaemon=zdaemon.zdctl:main
+entry-points =
+ zdaemon=zdaemon.zdctl:main
+ nosetests=nose:main
interpreter = python
Modified: api/trunk/docs/TODO.txt
===================================================================
--- api/trunk/docs/TODO.txt 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/docs/TODO.txt 2009-04-02 16:59:15 UTC (rev 12017)
@@ -10,6 +10,4 @@
* answers.xml (generated by implementor) needs a DTD
-* tests need to actually test
-
-* sample implementation(s)
+* Write tests for internationalization
Deleted: api/trunk/relax/classes.relax.xml
===================================================================
--- api/trunk/relax/classes.relax.xml 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/relax/classes.relax.xml 2009-04-02 16:59:15 UTC (rev 12017)
@@ -1,8 +0,0 @@
-<element name="licenses" xmlns="http://relaxng.org/ns/structure/1.0">
- <oneOrMore>
- <element name="license">
- <attribute name="id" />
- <text />
- </element>
- </oneOrMore>
-</element>
Deleted: api/trunk/relax/error.relax.xml
===================================================================
--- api/trunk/relax/error.relax.xml 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/relax/error.relax.xml 2009-04-02 16:59:15 UTC (rev 12017)
@@ -1,18 +0,0 @@
-<element name="error" xmlns="http://relaxng.org/ns/structure/1.0">
- <element name="id">
- <text/>
- </element>
-
- <element name="message">
- <text/>
- </element>
- <optional>
- <element name="traceback">
- <text/>
- </element>
- <element name="exception">
- <attribute name="type" />
- <text/>
- </element>
- </optional>
-</element>
Deleted: api/trunk/relax/issue.relax.xml
===================================================================
--- api/trunk/relax/issue.relax.xml 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/relax/issue.relax.xml 2009-04-02 16:59:15 UTC (rev 12017)
@@ -1,155 +0,0 @@
-<grammar xmlns="http://relaxng.org/ns/structure/1.0">
- <start>
- <element name="result">
- <group>
- <element name="license-uri">
- <text/>
- </element>
- <element name="license-name">
- <text/>
- </element>
- <element name="rdf">
- <ref name="d1_RDF"/>
- </element>
- <element name="licenserdf">
- <ref name="d1_RDF"/>
- </element>
- <element name="html">
- <interleave>
- <interleave>
- <oneOrMore>
- <element name="a">
- <group>
- <group>
- <attribute name="rel">
- <text/>
- </attribute>
- <attribute name="href">
- <text/>
- </attribute>
- </group>
- <interleave>
- <optional>
- <element name="img">
- <group>
- <attribute name="border">
- <text/>
- </attribute>
- <attribute name="alt">
- <text/>
- </attribute>
- <attribute name="src">
- <text/>
- </attribute>
- </group>
- </element>
- </optional>
- <text/>
- </interleave>
- </group>
- </element>
- </oneOrMore>
- <element name="br">
- <empty/>
- </element>
- </interleave>
- <text/>
- </interleave>
- </element>
- </group>
- </element>
- </start>
- <define name="d1_RDF">
- <element ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="RDF">
- <group>
- <optional>
- <element ns="http://web.resource.org/cc/" name="Work">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="about">
- <text/>
- </attribute>
- <interleave>
- <element name="license">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="resource">
- <text/>
- </attribute>
- </element>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="title">
- <text/>
- </element>
- </optional>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="date">
- <text/>
- </element>
- </optional>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="description">
- <text/>
- </element>
- </optional>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="type">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="resource">
- <text/>
- </attribute>
- </element>
- </optional>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="source">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="resource">
- <text/>
- </attribute>
- </element>
- </optional>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="creator">
- <element name="Agent">
- <text/>
- </element>
- </element>
- </optional>
- <optional>
- <element ns="http://purl.org/dc/elements/1.1/" name="rights">
- <element name="Agent">
- <text/>
- </element>
- </element>
- </optional>
- </interleave>
- </element>
- </optional>
- <element ns="http://web.resource.org/cc/" name="License">
- <group>
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="about">
- <text/>
- </attribute>
- <interleave>
- <zeroOrMore>
- <element name="requires">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="resource">
- <text/>
- </attribute>
- </element>
- </zeroOrMore>
- <zeroOrMore>
- <element name="prohibits">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="resource">
- <text/>
- </attribute>
- </element>
- </zeroOrMore>
- <zeroOrMore>
- <element name="permits">
- <attribute ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" name="resource">
- <text/>
- </attribute>
- </element>
- </zeroOrMore>
- </interleave>
- </group>
- </element>
- </group>
- </element>
- </define>
-</grammar>
Deleted: api/trunk/relax/licenseclass.relax.xml
===================================================================
--- api/trunk/relax/licenseclass.relax.xml 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/relax/licenseclass.relax.xml 2009-04-02 16:59:15 UTC (rev 12017)
@@ -1,37 +0,0 @@
-<element name="licenseclass"
- xmlns="http://relaxng.org/ns/structure/1.0">
- <attribute name="id" />
- <element name="label">
- <attribute name="xml:lang" />
- <text />
- </element>
-
- <zeroOrMore>
- <element name="field">
- <attribute name="id" />
- <element name="label">
- <attribute name="xml:lang" />
- <text/>
- </element>
- <element name="description">
- <attribute name="xml:lang" />
- <text/>
- </element>
- <element name="type">
- <text/>
- </element>
-
- <zeroOrMore>
- <element name="enum">
- <attribute name="id" />
- <element name="label">
- <attribute name="xml:lang" />
- <text/>
- </element>
- </element>
- </zeroOrMore>
-
- </element>
- </zeroOrMore>
-
-</element>
Deleted: api/trunk/relax/locales.relax.xml
===================================================================
--- api/trunk/relax/locales.relax.xml 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/relax/locales.relax.xml 2009-04-02 16:59:15 UTC (rev 12017)
@@ -1,8 +0,0 @@
-<element name="locales" xmlns="http://relaxng.org/ns/structure/1.0">
- <oneOrMore>
- <element name="locale">
- <attribute name="id" />
- <text />
- </element>
- </oneOrMore>
-</element>
Modified: api/trunk/rest_api.py
===================================================================
--- api/trunk/rest_api.py 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/rest_api.py 2009-04-02 16:59:15 UTC (rev 12017)
@@ -222,11 +222,9 @@
cherrypy.tree.mount(supportapi.SupportApi(), "/support")
cherrypy.engine.autoreload_match = None
- cherrypy.engine.start(blocking=False)
+ cherrypy.engine.start()
return cherrypy.tree
if __name__ == '__main__':
serveapi()
-
-
Modified: api/trunk/setup.py
===================================================================
--- api/trunk/setup.py 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/setup.py 2009-04-02 16:59:15 UTC (rev 12017)
@@ -33,13 +33,20 @@
'utidylib',
'zdaemon',
'Babel',
+ 'pylons',
+ 'WebTest',
+ 'Routes',
+ 'coverage',
],
dependency_links=['http://cctools.svn.sourceforge.net/svnroot/cctools/vendorlibs/utidylib/#egg=utidylib-0.2-cvs',],
entry_points = { 'console_scripts':
['server = rest_api:serveapi',
- 'test = tests.test:runTests',
+ 'coverage = tools:analyze_coverage',
],
+ 'paste.app_factory':
+ ['rest_api=rest_api:app_factory',
+ ],
},
# author metadata
Modified: api/trunk/simplechooser.py
===================================================================
--- api/trunk/simplechooser.py 2009-04-01 20:36:07 UTC (rev 12016)
+++ api/trunk/simplechooser.py 2009-04-02 16:59:15 UTC (rev 12017)
@@ -72,7 +72,6 @@
'//licenseclass[@id="standard"]/license/jurisdiction[@id="%s"]/'
'version/@id' % jurisdiction)
- print juris_versions
if version is not None:
# a particular version was requested; make sure this is a valid
# version for this jurisdiction
@@ -80,8 +79,6 @@
curr_version = str(version).strip()
else:
curr_version = max(juris_versions)
-
- print curr_version
# get the list of licenses for the specified domain
domain_licenses = all_licenses.xpath(
@@ -91,7 +88,6 @@
'//licenseclass[@id="publicdomain"]/license/jurisdiction[@id="-"]/'
'version[@id="-"]/@uri')
- print domain_licenses
# get the latest version of each license found
licenses = []
for l in domain_licenses:
More information about the cc-commits
mailing list