diff options
| author | David Della Vecchia <ddv@canonical.com> | 2016-02-16 11:28:17 -0500 |
|---|---|---|
| committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2016-02-17 19:26:12 +0000 |
| commit | 5083949a50e0bb4c15d126c98337406e7239b94c (patch) | |
| tree | c23a10876d9bd08545fa1d2b93733e5bd2688105 | |
| parent | 84e9bcf8f79f8da0712947e927218c3cdf2ddb69 (diff) | |
0.6-1ubuntu1 (patches unapplied)import/0.6-1ubuntu1ubuntu/zesty-develubuntu/zestyubuntu/yakkety-develubuntu/yakketyubuntu/xenial-proposedubuntu/xenial-develubuntu/xenialubuntu/eoan-develubuntu/eoanubuntu/disco-develubuntu/discoubuntu/cosmic-develubuntu/cosmicubuntu/bionic-develubuntu/bionicubuntu/artful-develubuntu/artful
Imported using git-ubuntu import.
Notes
Notes:
* d/rules: Add build tests.
* d/control: Add build deps to support tests.
* d/p/add_test_cases.patch: Add build specs required by tests.
| -rw-r--r-- | debian/changelog | 8 | ||||
| -rw-r--r-- | debian/control | 3 | ||||
| -rw-r--r-- | debian/patches/add_test_cases.patch | 797 | ||||
| -rw-r--r-- | debian/patches/series | 1 | ||||
| -rwxr-xr-x | debian/rules | 3 |
5 files changed, 812 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 32fdc44..5299e6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-uritemplate (0.6-1ubuntu1) xenial; urgency=medium + + * d/rules: Add build tests. + * d/control: Add build deps to support tests. + * d/p/add_test_cases.patch: Add build specs required by tests. + + -- David Della Vecchia <ddv@canonical.com> Tue, 16 Feb 2016 11:28:17 -0500 + python-uritemplate (0.6-1) unstable; urgency=medium * New upstream release. diff --git a/debian/control b/debian/control index 78fdf19..ffce263 100644 --- a/debian/control +++ b/debian/control @@ -6,8 +6,11 @@ Uploaders: Jimmy Kaplowitz <jimmy@debian.org>, Thomas Goirand <zigo@debian.org> Build-Depends: debhelper (>= 9), openstack-pkg-tools, python-all (>= 2.6.6-3~), + python-nose, python-setuptools, + python-simplejson (>= 2.5.0), python3-all (>= 3.2), + python3-nose, python3-setuptools Standards-Version: 3.9.5 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=cloud/python-uritemplate.git diff --git a/debian/patches/add_test_cases.patch b/debian/patches/add_test_cases.patch new file mode 100644 index 0000000..5fdfc53 --- /dev/null +++ b/debian/patches/add_test_cases.patch @@ -0,0 +1,797 @@ +Description: Add test specs. +Author: David Della Vecchia <ddv@canonical.com> +Origin: https://github.com/uri-templates/uritemplate-test +Forwarded: no +--- /dev/null ++++ b/test/cases/extended-tests.json +@@ -0,0 +1,76 @@ ++{ ++ "Additional Examples 1":{ ++ "level":4, ++ "variables":{ ++ "id" : "person", ++ "token" : "12345", ++ "fields" : ["id", "name", "picture"], ++ "format" : "json", ++ "q" : "URI Templates", ++ "page" : "5", ++ "lang" : "en", ++ "geocode" : ["37.76","-122.427"], ++ "first_name" : "John", ++ "last.name" : "Doe", ++ "Some%20Thing" : "foo", ++ "number" : 6, ++ "long" : 37.76, ++ "lat" : -122.427, ++ "group_id" : "12345", ++ "query" : "PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?book ?who WHERE { ?book dc:creator ?who }" ++ }, ++ "testcases":[ ++ ++ [ "{/id*}" , "/person" ], ++ [ "{/id*}{?fields,first_name,last.name,token}" , [ ++ "/person?fields=id,name,picture&first_name=John&last.name=Doe&token=12345", ++ "/person?fields=id,picture,name&first_name=John&last.name=Doe&token=12345", ++ "/person?fields=picture,name,id&first_name=John&last.name=Doe&token=12345", ++ "/person?fields=picture,id,name&first_name=John&last.name=Doe&token=12345", ++ "/person?fields=name,picture,id&first_name=John&last.name=Doe&token=12345", ++ "/person?fields=name,id,picture&first_name=John&last.name=Doe&token=12345"] ++ ], ++ ["/search.{format}{?q,geocode,lang,locale,page,result_type}", ++ [ "/search.json?q=URI%20Templates&geocode=37.76,-122.427&lang=en&page=5", ++ "/search.json?q=URI%20Templates&geocode=-122.427,37.76&lang=en&page=5"] ++ ], ++ ["/test{/Some%20Thing}", "/test/foo" ], ++ ["/set{?number}", "/set?number=6"], ++ ["/loc{?long,lat}" , "/loc?long=37.76&lat=-122.427"], ++ ["/base{/group_id,first_name}/pages{/page,lang}{?format,q}","/base/12345/John/pages/5/en?format=json&q=URI%20Templates"], ++ ["/sparql{?query}", "/sparql?query=PREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%20SELECT%20%3Fbook%20%3Fwho%20WHERE%20%7B%20%3Fbook%20dc%3Acreator%20%3Fwho%20%7D"] ++ ] ++ }, ++ "Additional Examples 2":{ ++ "level":4, ++ "variables":{ ++ "id" : ["person","albums"], ++ "token" : "12345", ++ "fields" : ["id", "name", "picture"], ++ "format" : "atom", ++ "q" : "URI Templates", ++ "page" : "10", ++ "start" : "5", ++ "lang" : "en", ++ "geocode" : ["37.76","-122.427"] ++ }, ++ "testcases":[ ++ ++ [ "{/id*}" , ["/person/albums","/albums/person"] ], ++ [ "{/id*}{?fields,token}" , [ ++ "/person/albums?fields=id,name,picture&token=12345", ++ "/person/albums?fields=id,picture,name&token=12345", ++ "/person/albums?fields=picture,name,id&token=12345", ++ "/person/albums?fields=picture,id,name&token=12345", ++ "/person/albums?fields=name,picture,id&token=12345", ++ "/person/albums?fields=name,id,picture&token=12345", ++ "/albums/person?fields=id,name,picture&token=12345", ++ "/albums/person?fields=id,picture,name&token=12345", ++ "/albums/person?fields=picture,name,id&token=12345", ++ "/albums/person?fields=picture,id,name&token=12345", ++ "/albums/person?fields=name,picture,id&token=12345", ++ "/albums/person?fields=name,id,picture&token=12345"] ++ ] ++ ] ++ } ++} +--- /dev/null ++++ b/test/cases/negative-tests.json +@@ -0,0 +1,50 @@ ++{ ++ "Failure Tests":{ ++ "level":4, ++ "variables":{ ++ "id" : "thing", ++ "var" : "value", ++ "hello" : "Hello World!", ++ "empty" : "", ++ "path" : "/foo/bar", ++ "x" : "1024", ++ "y" : "768", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "example" : "red", ++ "searchTerms" : "uri templates", ++ "~thing" : "some-user", ++ "default-graph-uri" : ["http://www.example/book/","http://www.example/papers/"], ++ "query" : "PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?book ?who WHERE { ?book dc:creator ?who }" ++ ++ }, ++ "testcases":[ ++ [ "{/id*", false ], ++ [ "/id*}", false ], ++ [ "{/?id}", false ], ++ [ "{var:prefix}", false ], ++ [ "{hello:2*}", false ] , ++ [ "{??hello}", false ] , ++ [ "{!hello}", false ] , ++ [ "{=path}", false ] , ++ [ "{$var}", false ], ++ [ "{|var*}", false ], ++ [ "{*keys?}", false ], ++ [ "{?empty=default,var}", false ], ++ [ "{var}{-prefix|/-/|var}" , false ], ++ [ "?q={searchTerms}&c={example:color?}" , false ], ++ [ "x{?empty|foo=none}" , false ], ++ [ "/h{#hello+}" , false ], ++ [ "/h#{hello+}" , false ], ++ [ "/vars/:var" , false ], ++ [ "{keys:1}", false ], ++ [ "{+keys:1}", false ], ++ [ "{;keys:1*}", false ], ++ [ "?{-join|&|var,list}" , false ], ++ [ "/people/{~thing}", false], ++ [ "/sparql{?query){&default-graph-uri*}", false ], ++ [ "/resolution{?x, y}" , false ] ++ ++ ] ++ } ++} +--- /dev/null ++++ b/test/cases/spec-examples-by-section.json +@@ -0,0 +1,437 @@ ++{ ++ "3.2.1 Variable Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{count}", "one,two,three"], ++ ["{count*}", "one,two,three"], ++ ["{/count}", "/one,two,three"], ++ ["{/count*}", "/one/two/three"], ++ ["{;count}", ";count=one,two,three"], ++ ["{;count*}", ";count=one;count=two;count=three"], ++ ["{?count}", "?count=one,two,three"], ++ ["{?count*}", "?count=one&count=two&count=three"], ++ ["{&count*}", "&count=one&count=two&count=three"] ++ ] ++ }, ++ "3.2.2 Simple String Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{var}", "value"], ++ ["{hello}", "Hello%20World%21"], ++ ["{half}", "50%25"], ++ ["O{empty}X", "OX"], ++ ["O{undef}X", "OX"], ++ ["{x,y}", "1024,768"], ++ ["{x,hello,y}", "1024,Hello%20World%21,768"], ++ ["?{x,empty}", "?1024,"], ++ ["?{x,undef}", "?1024"], ++ ["?{undef,y}", "?768"], ++ ["{var:3}", "val"], ++ ["{var:30}", "value"], ++ ["{list}", "red,green,blue"], ++ ["{list*}", "red,green,blue"], ++ ["{keys}", [ ++ "comma,%2C,dot,.,semi,%3B", ++ "comma,%2C,semi,%3B,dot,.", ++ "dot,.,comma,%2C,semi,%3B", ++ "dot,.,semi,%3B,comma,%2C", ++ "semi,%3B,comma,%2C,dot,.", ++ "semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{keys*}", [ ++ "comma=%2C,dot=.,semi=%3B", ++ "comma=%2C,semi=%3B,dot=.", ++ "dot=.,comma=%2C,semi=%3B", ++ "dot=.,semi=%3B,comma=%2C", ++ "semi=%3B,comma=%2C,dot=.", ++ "semi=%3B,dot=.,comma=%2C" ++ ]] ++ ] ++ }, ++ "3.2.3 Reserved Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{+var}", "value"], ++ ["{+hello}", "Hello%20World!"], ++ ["{+half}", "50%25"], ++ ["{base}index", "http%3A%2F%2Fexample.com%2Fhome%2Findex"], ++ ["{+base}index", "http://example.com/home/index"], ++ ["O{+empty}X", "OX"], ++ ["O{+undef}X", "OX"], ++ ["{+path}/here", "/foo/bar/here"], ++ ["{+path:6}/here", "/foo/b/here"], ++ ["here?ref={+path}", "here?ref=/foo/bar"], ++ ["up{+path}{var}/here", "up/foo/barvalue/here"], ++ ["{+x,hello,y}", "1024,Hello%20World!,768"], ++ ["{+path,x}/here", "/foo/bar,1024/here"], ++ ["{+list}", "red,green,blue"], ++ ["{+list*}", "red,green,blue"], ++ ["{+keys}", [ ++ "comma,,,dot,.,semi,;", ++ "comma,,,semi,;,dot,.", ++ "dot,.,comma,,,semi,;", ++ "dot,.,semi,;,comma,,", ++ "semi,;,comma,,,dot,.", ++ "semi,;,dot,.,comma,," ++ ]], ++ ["{+keys*}", [ ++ "comma=,,dot=.,semi=;", ++ "comma=,,semi=;,dot=.", ++ "dot=.,comma=,,semi=;", ++ "dot=.,semi=;,comma=,", ++ "semi=;,comma=,,dot=.", ++ "semi=;,dot=.,comma=," ++ ]] ++ ] ++ }, ++ "3.2.4 Fragment Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{#var}", "#value"], ++ ["{#hello}", "#Hello%20World!"], ++ ["{#half}", "#50%25"], ++ ["foo{#empty}", "foo#"], ++ ["foo{#undef}", "foo"], ++ ["{#x,hello,y}", "#1024,Hello%20World!,768"], ++ ["{#path,x}/here", "#/foo/bar,1024/here"], ++ ["{#path:6}/here", "#/foo/b/here"], ++ ["{#list}", "#red,green,blue"], ++ ["{#list*}", "#red,green,blue"], ++ ["{#keys}", [ ++ "#comma,,,dot,.,semi,;", ++ "#comma,,,semi,;,dot,.", ++ "#dot,.,comma,,,semi,;", ++ "#dot,.,semi,;,comma,,", ++ "#semi,;,comma,,,dot,.", ++ "#semi,;,dot,.,comma,," ++ ]] ++ ] ++ }, ++ "3.2.5 Label Expansion with Dot-Prefix" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{.who}", ".fred"], ++ ["{.who,who}", ".fred.fred"], ++ ["{.half,who}", ".50%25.fred"], ++ ["www{.dom*}", "www.example.com"], ++ ["X{.var}", "X.value"], ++ ["X{.var:3}", "X.val"], ++ ["X{.empty}", "X."], ++ ["X{.undef}", "X"], ++ ["X{.list}", "X.red,green,blue"], ++ ["X{.list*}", "X.red.green.blue"], ++ ["{#keys}", [ ++ "#comma,,,dot,.,semi,;", ++ "#comma,,,semi,;,dot,.", ++ "#dot,.,comma,,,semi,;", ++ "#dot,.,semi,;,comma,,", ++ "#semi,;,comma,,,dot,.", ++ "#semi,;,dot,.,comma,," ++ ]], ++ ["{#keys*}", [ ++ "#comma=,,dot=.,semi=;", ++ "#comma=,,semi=;,dot=.", ++ "#dot=.,comma=,,semi=;", ++ "#dot=.,semi=;,comma=,", ++ "#semi=;,comma=,,dot=.", ++ "#semi=;,dot=.,comma=," ++ ]], ++ ["X{.empty_keys}", "X"], ++ ["X{.empty_keys*}", "X"] ++ ] ++ }, ++ "3.2.6 Path Segment Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{/who}", "/fred"], ++ ["{/who,who}", "/fred/fred"], ++ ["{/half,who}", "/50%25/fred"], ++ ["{/who,dub}", "/fred/me%2Ftoo"], ++ ["{/var}", "/value"], ++ ["{/var,empty}", "/value/"], ++ ["{/var,undef}", "/value"], ++ ["{/var,x}/here", "/value/1024/here"], ++ ["{/var:1,var}", "/v/value"], ++ ["{/list}", "/red,green,blue"], ++ ["{/list*}", "/red/green/blue"], ++ ["{/list*,path:4}", "/red/green/blue/%2Ffoo"], ++ ["{/keys}", [ ++ "/comma,%2C,dot,.,semi,%3B", ++ "/comma,%2C,semi,%3B,dot,.", ++ "/dot,.,comma,%2C,semi,%3B", ++ "/dot,.,semi,%3B,comma,%2C", ++ "/semi,%3B,comma,%2C,dot,.", ++ "/semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{/keys*}", [ ++ "/comma=%2C/dot=./semi=%3B", ++ "/comma=%2C/semi=%3B/dot=.", ++ "/dot=./comma=%2C/semi=%3B", ++ "/dot=./semi=%3B/comma=%2C", ++ "/semi=%3B/comma=%2C/dot=.", ++ "/semi=%3B/dot=./comma=%2C" ++ ]] ++ ] ++ }, ++ "3.2.7 Path-Style Parameter Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{;who}", ";who=fred"], ++ ["{;half}", ";half=50%25"], ++ ["{;empty}", ";empty"], ++ ["{;hello:5}", ";hello=Hello"], ++ ["{;v,empty,who}", ";v=6;empty;who=fred"], ++ ["{;v,bar,who}", ";v=6;who=fred"], ++ ["{;x,y}", ";x=1024;y=768"], ++ ["{;x,y,empty}", ";x=1024;y=768;empty"], ++ ["{;x,y,undef}", ";x=1024;y=768"], ++ ["{;list}", ";list=red,green,blue"], ++ ["{;list*}", ";list=red;list=green;list=blue"], ++ ["{;keys}", [ ++ ";keys=comma,%2C,dot,.,semi,%3B", ++ ";keys=comma,%2C,semi,%3B,dot,.", ++ ";keys=dot,.,comma,%2C,semi,%3B", ++ ";keys=dot,.,semi,%3B,comma,%2C", ++ ";keys=semi,%3B,comma,%2C,dot,.", ++ ";keys=semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{;keys*}", [ ++ ";comma=%2C;dot=.;semi=%3B", ++ ";comma=%2C;semi=%3B;dot=.", ++ ";dot=.;comma=%2C;semi=%3B", ++ ";dot=.;semi=%3B;comma=%2C", ++ ";semi=%3B;comma=%2C;dot=.", ++ ";semi=%3B;dot=.;comma=%2C" ++ ]] ++ ] ++ }, ++ "3.2.8 Form-Style Query Expansion" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{?who}", "?who=fred"], ++ ["{?half}", "?half=50%25"], ++ ["{?x,y}", "?x=1024&y=768"], ++ ["{?x,y,empty}", "?x=1024&y=768&empty="], ++ ["{?x,y,undef}", "?x=1024&y=768"], ++ ["{?var:3}", "?var=val"], ++ ["{?list}", "?list=red,green,blue"], ++ ["{?list*}", "?list=red&list=green&list=blue"], ++ ["{?keys}", [ ++ "?keys=comma,%2C,dot,.,semi,%3B", ++ "?keys=comma,%2C,semi,%3B,dot,.", ++ "?keys=dot,.,comma,%2C,semi,%3B", ++ "?keys=dot,.,semi,%3B,comma,%2C", ++ "?keys=semi,%3B,comma,%2C,dot,.", ++ "?keys=semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{?keys*}", [ ++ "?comma=%2C&dot=.&semi=%3B", ++ "?comma=%2C&semi=%3B&dot=.", ++ "?dot=.&comma=%2C&semi=%3B", ++ "?dot=.&semi=%3B&comma=%2C", ++ "?semi=%3B&comma=%2C&dot=.", ++ "?semi=%3B&dot=.&comma=%2C" ++ ]] ++ ] ++ }, ++ "3.2.9 Form-Style Query Continuation" : ++ { ++ "variables": { ++ "count" : ["one", "two", "three"], ++ "dom" : ["example", "com"], ++ "dub" : "me/too", ++ "hello" : "Hello World!", ++ "half" : "50%", ++ "var" : "value", ++ "who" : "fred", ++ "base" : "http://example.com/home/", ++ "path" : "/foo/bar", ++ "list" : ["red", "green", "blue"], ++ "keys" : { "semi" : ";", "dot" : ".", "comma" : ","}, ++ "v" : "6", ++ "x" : "1024", ++ "y" : "768", ++ "empty" : "", ++ "empty_keys" : [], ++ "undef" : null ++ }, ++ "testcases" : [ ++ ["{&who}", "&who=fred"], ++ ["{&half}", "&half=50%25"], ++ ["?fixed=yes{&x}", "?fixed=yes&x=1024"], ++ ["{&var:3}", "&var=val"], ++ ["{&x,y,empty}", "&x=1024&y=768&empty="], ++ ["{&x,y,undef}", "&x=1024&y=768"], ++ ["{&list}", "&list=red,green,blue"], ++ ["{&list*}", "&list=red&list=green&list=blue"], ++ ["{&keys}", [ ++ "&keys=comma,%2C,dot,.,semi,%3B", ++ "&keys=comma,%2C,semi,%3B,dot,.", ++ "&keys=dot,.,comma,%2C,semi,%3B", ++ "&keys=dot,.,semi,%3B,comma,%2C", ++ "&keys=semi,%3B,comma,%2C,dot,.", ++ "&keys=semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{&keys*}", [ ++ "&comma=%2C&dot=.&semi=%3B", ++ "&comma=%2C&semi=%3B&dot=.", ++ "&dot=.&comma=%2C&semi=%3B", ++ "&dot=.&semi=%3B&comma=%2C", ++ "&semi=%3B&comma=%2C&dot=.", ++ "&semi=%3B&dot=.&comma=%2C" ++ ]] ++ ] ++ } ++} +--- /dev/null ++++ b/test/cases/spec-examples.json +@@ -0,0 +1,218 @@ ++{ ++ "Level 1 Examples" : ++ { ++ "level": 1, ++ "variables": { ++ "var" : "value", ++ "hello" : "Hello World!" ++ }, ++ "testcases" : [ ++ ["{var}", "value"], ++ ["{hello}", "Hello%20World%21"] ++ ] ++ }, ++ "Level 2 Examples" : ++ { ++ "level": 2, ++ "variables": { ++ "var" : "value", ++ "hello" : "Hello World!", ++ "path" : "/foo/bar" ++ }, ++ "testcases" : [ ++ ["{+var}", "value"], ++ ["{+hello}", "Hello%20World!"], ++ ["{+path}/here", "/foo/bar/here"], ++ ["here?ref={+path}", "here?ref=/foo/bar"] ++ ] ++ }, ++ "Level 3 Examples" : ++ { ++ "level": 3, ++ "variables": { ++ "var" : "value", ++ "hello" : "Hello World!", ++ "empty" : "", ++ "path" : "/foo/bar", ++ "x" : "1024", ++ "y" : "768" ++ }, ++ "testcases" : [ ++ ["map?{x,y}", "map?1024,768"], ++ ["{x,hello,y}", "1024,Hello%20World%21,768"], ++ ["{+x,hello,y}", "1024,Hello%20World!,768"], ++ ["{+path,x}/here", "/foo/bar,1024/here"], ++ ["{#x,hello,y}", "#1024,Hello%20World!,768"], ++ ["{#path,x}/here", "#/foo/bar,1024/here"], ++ ["X{.var}", "X.value"], ++ ["X{.x,y}", "X.1024.768"], ++ ["{/var}", "/value"], ++ ["{/var,x}/here", "/value/1024/here"], ++ ["{;x,y}", ";x=1024;y=768"], ++ ["{;x,y,empty}", ";x=1024;y=768;empty"], ++ ["{?x,y}", "?x=1024&y=768"], ++ ["{?x,y,empty}", "?x=1024&y=768&empty="], ++ ["?fixed=yes{&x}", "?fixed=yes&x=1024"], ++ ["{&x,y,empty}", "&x=1024&y=768&empty="] ++ ] ++ }, ++ "Level 4 Examples" : ++ { ++ "level": 4, ++ "variables": { ++ "var": "value", ++ "hello": "Hello World!", ++ "path": "/foo/bar", ++ "list": ["red", "green", "blue"], ++ "keys": {"semi": ";", "dot": ".", "comma":","} ++ }, ++ "testcases": [ ++ ["{var:3}", "val"], ++ ["{var:30}", "value"], ++ ["{list}", "red,green,blue"], ++ ["{list*}", "red,green,blue"], ++ ["{keys}", [ ++ "comma,%2C,dot,.,semi,%3B", ++ "comma,%2C,semi,%3B,dot,.", ++ "dot,.,comma,%2C,semi,%3B", ++ "dot,.,semi,%3B,comma,%2C", ++ "semi,%3B,comma,%2C,dot,.", ++ "semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{keys*}", [ ++ "comma=%2C,dot=.,semi=%3B", ++ "comma=%2C,semi=%3B,dot=.", ++ "dot=.,comma=%2C,semi=%3B", ++ "dot=.,semi=%3B,comma=%2C", ++ "semi=%3B,comma=%2C,dot=.", ++ "semi=%3B,dot=.,comma=%2C" ++ ]], ++ ["{+path:6}/here", "/foo/b/here"], ++ ["{+list}", "red,green,blue"], ++ ["{+list*}", "red,green,blue"], ++ ["{+keys}", [ ++ "comma,,,dot,.,semi,;", ++ "comma,,,semi,;,dot,.", ++ "dot,.,comma,,,semi,;", ++ "dot,.,semi,;,comma,,", ++ "semi,;,comma,,,dot,.", ++ "semi,;,dot,.,comma,," ++ ]], ++ ["{+keys*}", [ ++ "comma=,,dot=.,semi=;", ++ "comma=,,semi=;,dot=.", ++ "dot=.,comma=,,semi=;", ++ "dot=.,semi=;,comma=,", ++ "semi=;,comma=,,dot=.", ++ "semi=;,dot=.,comma=," ++ ]], ++ ["{#path:6}/here", "#/foo/b/here"], ++ ["{#list}", "#red,green,blue"], ++ ["{#list*}", "#red,green,blue"], ++ ["{#keys}", [ ++ "#comma,,,dot,.,semi,;", ++ "#comma,,,semi,;,dot,.", ++ "#dot,.,comma,,,semi,;", ++ "#dot,.,semi,;,comma,,", ++ "#semi,;,comma,,,dot,.", ++ "#semi,;,dot,.,comma,," ++ ]], ++ ["{#keys*}", [ ++ "#comma=,,dot=.,semi=;", ++ "#comma=,,semi=;,dot=.", ++ "#dot=.,comma=,,semi=;", ++ "#dot=.,semi=;,comma=,", ++ "#semi=;,comma=,,dot=.", ++ "#semi=;,dot=.,comma=," ++ ]], ++ ["X{.var:3}", "X.val"], ++ ["X{.list}", "X.red,green,blue"], ++ ["X{.list*}", "X.red.green.blue"], ++ ["X{.keys}", [ ++ "X.comma,%2C,dot,.,semi,%3B", ++ "X.comma,%2C,semi,%3B,dot,.", ++ "X.dot,.,comma,%2C,semi,%3B", ++ "X.dot,.,semi,%3B,comma,%2C", ++ "X.semi,%3B,comma,%2C,dot,.", ++ "X.semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{/var:1,var}", "/v/value"], ++ ["{/list}", "/red,green,blue"], ++ ["{/list*}", "/red/green/blue"], ++ ["{/list*,path:4}", "/red/green/blue/%2Ffoo"], ++ ["{/keys}", [ ++ "/comma,%2C,dot,.,semi,%3B", ++ "/comma,%2C,semi,%3B,dot,.", ++ "/dot,.,comma,%2C,semi,%3B", ++ "/dot,.,semi,%3B,comma,%2C", ++ "/semi,%3B,comma,%2C,dot,.", ++ "/semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{/keys*}", [ ++ "/comma=%2C/dot=./semi=%3B", ++ "/comma=%2C/semi=%3B/dot=.", ++ "/dot=./comma=%2C/semi=%3B", ++ "/dot=./semi=%3B/comma=%2C", ++ "/semi=%3B/comma=%2C/dot=.", ++ "/semi=%3B/dot=./comma=%2C" ++ ]], ++ ["{;hello:5}", ";hello=Hello"], ++ ["{;list}", ";list=red,green,blue"], ++ ["{;list*}", ";list=red;list=green;list=blue"], ++ ["{;keys}", [ ++ ";keys=comma,%2C,dot,.,semi,%3B", ++ ";keys=comma,%2C,semi,%3B,dot,.", ++ ";keys=dot,.,comma,%2C,semi,%3B", ++ ";keys=dot,.,semi,%3B,comma,%2C", ++ ";keys=semi,%3B,comma,%2C,dot,.", ++ ";keys=semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{;keys*}", [ ++ ";comma=%2C;dot=.;semi=%3B", ++ ";comma=%2C;semi=%3B;dot=.", ++ ";dot=.;comma=%2C;semi=%3B", ++ ";dot=.;semi=%3B;comma=%2C", ++ ";semi=%3B;comma=%2C;dot=.", ++ ";semi=%3B;dot=.;comma=%2C" ++ ]], ++ ["{?var:3}", "?var=val"], ++ ["{?list}", "?list=red,green,blue"], ++ ["{?list*}", "?list=red&list=green&list=blue"], ++ ["{?keys}", [ ++ "?keys=comma,%2C,dot,.,semi,%3B", ++ "?keys=comma,%2C,semi,%3B,dot,.", ++ "?keys=dot,.,comma,%2C,semi,%3B", ++ "?keys=dot,.,semi,%3B,comma,%2C", ++ "?keys=semi,%3B,comma,%2C,dot,.", ++ "?keys=semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{?keys*}", [ ++ "?comma=%2C&dot=.&semi=%3B", ++ "?comma=%2C&semi=%3B&dot=.", ++ "?dot=.&comma=%2C&semi=%3B", ++ "?dot=.&semi=%3B&comma=%2C", ++ "?semi=%3B&comma=%2C&dot=.", ++ "?semi=%3B&dot=.&comma=%2C" ++ ]], ++ ["{&var:3}", "&var=val"], ++ ["{&list}", "&list=red,green,blue"], ++ ["{&list*}", "&list=red&list=green&list=blue"], ++ ["{&keys}", [ ++ "&keys=comma,%2C,dot,.,semi,%3B", ++ "&keys=comma,%2C,semi,%3B,dot,.", ++ "&keys=dot,.,comma,%2C,semi,%3B", ++ "&keys=dot,.,semi,%3B,comma,%2C", ++ "&keys=semi,%3B,comma,%2C,dot,.", ++ "&keys=semi,%3B,dot,.,comma,%2C" ++ ]], ++ ["{&keys*}", [ ++ "&comma=%2C&dot=.&semi=%3B", ++ "&comma=%2C&semi=%3B&dot=.", ++ "&dot=.&comma=%2C&semi=%3B", ++ "&dot=.&semi=%3B&comma=%2C", ++ "&semi=%3B&comma=%2C&dot=.", ++ "&semi=%3B&dot=.&comma=%2C" ++ ]] ++ ] ++ } ++} diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..787873b --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +add_test_cases.patch diff --git a/debian/rules b/debian/rules index b6d7d1e..48d68fe 100755 --- a/debian/rules +++ b/debian/rules @@ -18,3 +18,6 @@ override_dh_auto_install: python$$pyvers setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python3-uritemplate; \ done + +override_dh_auto_test: + cd test && make |
