File: http-regex.ttl

package info (click to toggle)
libtest-fitesque-rdf-perl 0.100-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 320 kB
  • sloc: perl: 243; makefile: 4
file content (75 lines) | stat: -rw-r--r-- 2,279 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@prefix test: <http://ontologi.es/doap-tests#> .
@prefix deps: <http://ontologi.es/doap-deps#>.
@prefix httph:<http://www.w3.org/2007/ont/httph#> .
@prefix http: <http://www.w3.org/2007/ont/http#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
@prefix dqm:  <http://purl.org/dqm-vocabulary/v1/dqm#> .
@prefix :     <http://example.org/test#> .

:test_list a test:FixtureTable ;
    test:fixtures (
        :check_acl_location
    ) .

<http://example.org/httplist#http_req_res_list_regex> a nfo:SoftwareItem ;
    deps:test-requirement "Internal::Fixture::HTTPList"^^deps:CpanId ;
    nfo:definesFunction "http_req_res_list_regex" .


:check_acl_location a test:AutomatedTest ;
    test:purpose "Test fields with regexps"@en ;
    test:test_script <http://example.org/httplist#http_req_res_list_regex> ;
    test:params [
        test:steps (
            [
                test:request :check_acl_location_req ;
                test:response_assertion :check_acl_location_res
            ]
            [
                test:request :put_new_acl_req ;
                test:response_assertion :put_new_acl_res
            ]
            [
                test:request :check_result_req ;
                test:response_assertion :check_result_res
            ]
        )
    ] .


:check_acl_location_req a http:RequestMessage ;
    http:method "HEAD" ;
    http:requestURI </> .

:check_acl_location_res a http:ResponseMessage ;
    httph:link '<(.*?)>;\\s+rel="acl"'^^dqm:regex ;
    http:status 200 .

:put_new_acl_req a http:RequestMessage ;
    http:method "PUT" ;
    httph:content_type "text/turtle" ;
    http:content """
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
<#owner> a acl:Authorization;
acl:default </>;
acl:accessTo </>;
acl:agent <profile/card#me>;
acl:mode acl:Read. """ .


:put_new_acl_res a http:ResponseMessage ;
    http:status "201|204"^^dqm:regex .

:check_result_req a http:RequestMessage ;
    http:method "GET" ;
    httph:accept "text/turtle" .

:check_result_res a http:ResponseMessage ;
    http:status "301" ;
    httph:location 'http://(.*?)/'^^dqm:regex;
    httph:content_type 'text/turtle';
    httph:other_header 'something (.*?) between'^^dqm:regex.