_caldav__macOS_add_event (private)

 _caldav__macOS_add_event

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_test::visualize_control_chars aa_test::visualize_control_chars aa_true aa_true (public) _caldav__macOS_add_event _caldav__macOS_add_event _caldav__macOS_add_event->aa_equals _caldav__macOS_add_event->aa_log _caldav__macOS_add_event->aa_log_result _caldav__macOS_add_event->aa_test::visualize_control_chars _caldav__macOS_add_event->aa_true

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    set info [::caldav::test::basic_setup]
    set user_info [dict get $info user_info]

    try {
        #
        # We want a valid calendar entry without an entry in cal_uids.
        #
        set uid 8750

        set uid "23009F17-383F-4FBD-92D4-AB0F27CF7326"

        #
        # Make sure, uid of the item to be inserted newly does not
        # exist.
        #
        set cal_info [::caldav::calendars get_calendar_and_cal_item_from_uid $uid]
        if {[llength $cal_info] > 0} {
            #
            # Someone has already inserted such an item. Remove it!
            #
            lassign [lindex $cal_info 0] calendar_id cal_item_id
            aa_log "deleting cal_item $cal_item_id with uid $uid"
            calendar::item::delete -cal_item_id $cal_item_id
        }

        set icalText ""
        append icalText  {BEGIN:VCALENDAR} \r\n {VERSION:2.0} \r\n {PRODID:-//Apple Inc.//macOS 10.13.3//EN} \r\n {CALSCALE:GREGORIAN} \r\n {BEGIN:VTIMEZONE} \r\n {TZID:Europe/Vienna} \r\n {BEGIN:DAYLIGHT} \r\n {TZOFFSETFROM:+0100} \r\n {RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU} \r\n {DTSTART:19810329T020000} \r\n {TZNAME:GMT+2} \r\n {TZOFFSETTO:+0200} \r\n {END:DAYLIGHT} \r\n {BEGIN:STANDARD} \r\n {TZOFFSETFROM:+0200} \r\n {RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU} \r\n {DTSTART:19961027T030000} \r\n {TZNAME:GMT+1} \r\n {TZOFFSETTO:+0100} \r\n {END:STANDARD} \r\n {END:VTIMEZONE} \r\n {BEGIN:VEVENT} \r\n {CREATED:20180401T165215Z} \r\n {UID:23009F17-383F-4FBD-92D4-AB0F27CF7326} \r\n {DTEND;TZID=Europe/Vienna:20180402T100000} \r\n {TRANSP:OPAQUE} \r\n {X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC} \r\n {SUMMARY:a new event} \r\n {DTSTART;TZID=Europe/Vienna:20180402T090000} \r\n {DTSTAMP:20180401T165246Z} \r\n {SEQUENCE:0} \r\n {END:VEVENT} \r\n {END:VCALENDAR} \r\n 
        set created [::caldav::test::ical_extract $icalText CREATED]
        set DTSTART [lindex [::caldav::test::ical_extract $icalText DTSTART] end]
        set DTEND   [lindex [::caldav::test::ical_extract $icalText DTEND]]

        aa_log "created $created DTSTART $DTSTART DTEND $DTEND"

        #======== <DTSTART;TZID=Europe/Vienna:20180402T090000>
        #set_date_time: set_date_time parses 20180402 090000 0 -> 2018-04-02 09:00

        # ======== <DTEND;TZID=Europe/Vienna:20180402T100000>
        # set_date_time: set_date_time parses 20180402 100000 0 -> 2018-04-02 10:00

        # X-WR-CALNAME:Main Site Calendar for Gustaf Neumann
        # PRODID:-//OpenACS//OpenACS 6.0 MIMEDIR//EN
        # CALSCALE:GREGORIAN
        # VERSION:2.0
        # METHOD:PUBLISH
        # BEGIN:VEVENT
        # CREATED:20180402T081947Z
        # LAST-MODIFIED:20180402T082620Z
        # DTSTAMP:20180402T081947Z
        # DTSTART:20180402T100000Z
        # DTEND:20180402T110000Z
        # UID:15012
        # DESCRIPTION:1h
        # SUMMARY:high noon (created in OpenACS)
        # SEQUENCE:0
        # END:VEVENT
        # END:VCALENDAR

        # BEGIN:VCALENDAR
        # VERSION:2.0
        # PRODID:-//Apple Inc.//macOS 10.13.3//EN
        # CALSCALE:GREGORIAN
        # BEGIN:VTIMEZONE
        # TZID:Europe/Vienna
        # BEGIN:DAYLIGHT
        # TZOFFSETFROM:+0100
        # RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
        # DTSTART:19810329T020000
        # TZNAME:GMT+2
        # TZOFFSETTO:+0200
        # END:DAYLIGHT
        # BEGIN:STANDARD
        # TZOFFSETFROM:+0200
        # RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
        # DTSTART:19961027T030000
        # TZNAME:GMT+1
        # TZOFFSETTO:+0100
        # END:STANDARD
        # END:VTIMEZONE
        # BEGIN:VEVENT
        # CREATED:20180402T084642Z
        # UID:6B1BDFCB-A069-4BEB-82EB-C3DF13925772
        # DTEND;TZID=Europe/Vienna:20180402T180000
        # SUMMARY:tea time (from Calendar)
        # DTSTART;TZID=Europe/Vienna:20180402T170000
        # DTSTAMP:20180402T084755Z
        # SEQUENCE:0
        # DESCRIPTION:from Calendar
        # END:VEVENT
        # END:VCALENDAR


    set d [::acs::test::http  -user_info $user_info  -method PUT  -headers {Content-Type text/calendar}  -body $icalText  /caldav/calendar/$uid.ics]

        aa_equals "Status code valid" [dict get $d status] 201
        set isummary [::caldav::test::ical_extract $icalText SUMMARY]

    set d [::acs::test::http  -user_info $user_info  -method GET  /caldav/calendar/$uid.ics]

    set rIcalText [dict get $d body]
    aa_log "Result body:<pre>\n[::aa_test::visualize_control_chars $rIcalText]<pre>"
        aa_equals "Retrieved Ical valid" [::caldav::test::ical_valid $rIcalText""

        set rlocation    [::caldav::test::ical_extract $rIcalText LOCATION]
        set rsummary     [::caldav::test::ical_extract $rIcalText SUMMARY]

        aa_equals "location empty"        $rlocation ""
        aa_true   "last_modified updated" {$isummary eq $rsummary}

    } 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" "macOS_add_event (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: