_caldav__get_calitems (private)

 _caldav__get_calitems

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_run_with_teardown aa_run_with_teardown (public) aa_section aa_section (public) _caldav__get_calitems _caldav__get_calitems _caldav__get_calitems->aa_equals _caldav__get_calitems->aa_log _caldav__get_calitems->aa_log_result _caldav__get_calitems->aa_run_with_teardown _caldav__get_calitems->aa_section

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    #
    # The API test can run basic_setup and tests in a single
    # transaction, which is finally rolled back
    #
    aa_run_with_teardown -rollback -test_code {
    set info [::caldav::test::basic_setup]
    #aa_log $info

    set event_list [::caldav::calendars get_calitems  -user_id [dict get $info user_id]  -start_date "2019-01-01 00:00:00.0+02"  -end_date   "2019-01-07 23:59:00.0+02"  -calendar_ids [dict get $info calendar_id]]
    #
    # The items created via basic_setup can be retrieved within
    # the transaction over this interface.
    #
    aa_log "found [llength $event_list] cal items in calendar [dict get $info calendar_id] for check period"
    aa_true "number retrieved times is the same as in setup dict" {
        [llength [dict get $info cal_item_ids]] == [llength $event_list]
    }
    set item_summary [::caldav::test::item_stats $event_list]

    aa_equals "Calendar entries:"  {integer_uid 3 recurrence 1 uid 3}  [lsort -stride 2 $item_summary]

    set ical_text [::caldav::test::render_items -name [dict get $info calendar_name] $event_list]
        aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $ical_text]</pre>"

    aa_equals "Ical valid" [::caldav::test::ical_valid $ical_text""
    set ical_summary [::caldav::test::ical_stats $ical_text]
    foreach {key value} {continuation_lines 7 lines 45 lines_without_crlf 1 nr_uids 3} {
        aa_equals "Ical text has $key $value"  [dict get $ical_summary $key$value
    }

    #
    # Get the full private calendar
    #
        set user_id [dict get $info user_id]
        aa_section "Get private calendar of user $user_id"
    set private_calendar_id [::caldav::get_sync_calendar -user_id $user_id]
        aa_true "caldav::get_sync_calendar returns same calendar_id as setup" {
            $private_calendar_id eq [dict get $info priv_calendar_id]
        }
    aa_log "user $user_id: Private calendar $private_calendar_id vs. [dict get $info priv_calendar_id]"
    calendar::get -calendar_id $private_calendar_id -array calInfo

    set event_list [::caldav::calendars get_calitems  -user_id [dict get $info user_id]  -calendar_ids $private_calendar_id]
    set item_summary [::caldav::test::item_stats $event_list]
    aa_equals "Calendar entries of calendar $private_calendar_id:"  [lsort -stride 2 $item_summary]  {integer_uid 3 recurrence 1 uid 3}

    set ical_text [::caldav::test::render_items -name $calInfo(calendar_name) $event_list]
        aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $ical_text]</pre>"

    aa_equals "Ical valid" [::caldav::test::ical_valid $ical_text""
    set ical_summary [::caldav::test::ical_stats $ical_text]
        aa_log $ical_summary
    foreach {key value} {continuation_lines 0 lines_without_crlf 1 nr_uids 3} {
        aa_equals "Ical text has $key $value" [dict get $ical_summary $key$value
    }
        aa_true "have at least 17 lines " {[dict get $ical_summary lines]  >= 17}
    }
}} {
          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_calitems (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: