_caldav__GET (private)

 _caldav__GET

Defined in packages/caldav/tcl/test/caldav-test-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_section aa_section (public) aa_test::visualize_control_chars aa_test::visualize_control_chars _caldav__GET _caldav__GET _caldav__GET->aa_equals _caldav__GET->aa_log _caldav__GET->aa_log_result _caldav__GET->aa_section _caldav__GET->aa_test::visualize_control_chars

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    try {
    set info [::caldav::test::basic_setup]
    set user_id [dict get $info user_id]
        set user_info [dict get $info user_info]
    set temp_calendar_id [dict get $info calendar_id]
    set temp_calendar_items [llength [dict get $info cal_item_ids]]
    set personal_calendar_id 0
    set personal_calendar_id [::caldav::get_sync_calendar -user_id $user_id]
        aa_log "temp_calendar_id $temp_calendar_id, personal_calendar_id $personal_calendar_id"

    foreach {calendar_id nr_uids label} [subst {
        $temp_calendar_id $temp_calendar_items "testing calendar"
        $personal_calendar_id 3 "private calendar"
    }] {
        if {$calendar_id == 0} continue

            foreach template {
                {/caldav/calendar/?calendar_ids=$calendar_id}
                {/caldav/calendar/$calendar_id}
            } {
                set URL [subst $template]
                aa_section "$label $URL"

                set d [::acs::test::http -user_info $user_info $URL]
                #ns_log notice "run returns $d"
                #ns_log notice "... [ns_set array [dict get $d headers]]"

                set ical_text [dict get $d body]
                set ical_stats [::caldav::test::ical_stats $ical_text]
                aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $ical_text]</pre>"
                acs::test::reply_has_status_code $d 200

                set content_length [ns_set iget [dict get $d headers] content-length]
                aa_true "Content-Length $content_length plausible" {$content_length > 200}
                aa_equals "Ical valid" [::caldav::test::ical_valid $ical_text""
                aa_equals "Expect $nr_uids items with uids ([dict get $ical_stats uids])"  [dict get $ical_stats nr_uids]  $nr_uids

                #
                # Retrieve every single uid from calendar
                #
                foreach uid [dict get $ical_stats uids] {
                    aa_section "Retrieve single uid $uid from $label $calendar_id"
                    set URL /caldav/calendar/$calendar_id/$uid.ics
                    aa_log "Get ical for single uid $uid from calendar $calendar_id: $URL"
                    set d [::acs::test::http -user_info $user_info $URL]
                    #ns_log notice "run returns $d"
                    #ns_log notice "... [ns_set array [dict get $d headers]]"

                    aa_equals "Status code valid" [dict get $d status] 200
                    set ical_text [dict get $d body]
                    set ical_stats [::caldav::test::ical_stats $ical_text]
                    set content_length [ns_set iget [dict get $d headers] content-length]
                    aa_true "Content-Length $content_length plausible" {$content_length > 200}
                    aa_equals "Ical valid" [::caldav::test::ical_valid $ical_text""
                    aa_log <pre>[::aa_test::visualize_control_chars $ical_text]</pre>
                    aa_equals "Expect 1 item with uids ([dict get $ical_stats uids])" [dict get $ical_stats nr_uids] 1
                }
            }
    }

    } on error {errorMsg} {
    aa_true "Error msg: $errorMsg" 0
    } finally {
    calendar::delete -calendar_id $temp_calendar_id
    }
}} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "GET (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: