_caldav__macOS_add_location (private)

 _caldav__macOS_add_location

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_location _caldav__macOS_add_location _caldav__macOS_add_location->aa_equals _caldav__macOS_add_location->aa_log _caldav__macOS_add_location->aa_log_result _caldav__macOS_add_location->aa_test::visualize_control_chars _caldav__macOS_add_location->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.
        #
        # Get form the user calendar the first (lowest) uid
        #
        set uid [::caldav::test::get_lowest_uid -user_info $user_info]
        aa_log "get_lowest_uid -> '$uid' ($user_info)"

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

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

        set olocation      [::caldav::test::ical_extract $originalIcalText LOCATION]
        set olast_modified [::caldav::test::ical_extract $originalIcalText LAST-MODIFIED]
        aa_log "location: $olocation"
        aa_log "last-mod: $olast_modified"
        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:VEVENT} \r\n {CREATED:20190420T120804Z} \r\n {LAST-MODIFIED:20190420T120804Z} \r\n {DTSTAMP:20190420T120804Z} \r\n {DTSTART:20190420T111933Z} \r\n {DTEND:20190420T121933Z} \r\n "UID:$uid" \r\n {DESCRIPTION:my first private entry} \r\n {SUMMARY:remember!} \r\n {TRANSP:OPAQUE} \r\n {LOCATION:WU Wien\nWelthandelsplatz 1\, 1020 Vienna\, Austria} \r\n {SEQUENCE:0} \r\n {X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC} \r\n {X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-APPLE-MAPKIT-HANDLE=CAES/wEIrk0Q} \r\n { 0rr2qKC0qb5cGhIJJLddQ14bSEARAAAAeLRoMEAihAEKB0F1c3RyaWESAkFUGgZWaWVubmEy} \r\n { BlZpZW5uYToEMTAyMFISV2VsdGhhbmRlbHNwbGF0eiAxWgExYhJXZWx0aGFuZGVsc3BsYXR6} \r\n { IDFyHFdpcnRzY2hhZnRzdW5pdmVyc2l0w6R0IFdpZW6KAQZCZXppcmuKAQxMZW9wb2xkc3Rh} \r\n { ZHQqK1ZpZW5uYSBVbml2ZXJzaXR5IG9mIEVjb25vbWljcyBhbmQgQnVzaW5lc3MyEldlbHRo} \r\n { YW5kZWxzcGxhdHogMTILMTAyMCBWaWVubmEyB0F1c3RyaWE=;X-APPLE-RADIUS=6267.432} \r\n { 12890625;X-TITLE="WU Wien\nWelthandelsplatz 1, 1020 Vienna, Austria":geo} \r\n { :48.213814,16.409004} \r\n {BEGIN:VALARM} \r\n {X-WR-ALARMUID:05AD14A0-51DA-411C-9D8C-57C991801196} \r\n {UID:05AD14A0-51DA-411C-9D8C-57C991801196} \r\n {TRIGGER:-PT15H} \r\n {X-APPLE-DEFAULT-ALARM:TRUE} \r\n {ATTACH;VALUE=URI:Basso} \r\n {ACTION:AUDIO} \r\n {END:VALARM} \r\n {END:VEVENT} \r\n {END:VCALENDAR} \r\n

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

        aa_equals "Status code valid" [dict get $d status] 201
        set mlocation      [::caldav::test::ical_extract $icalText LOCATION]
        set mlast_modified [::caldav::test::ical_extract $icalText LAST-MODIFIED]
        set d [::acs::test::http  -user_info $user_info  -method GET  /caldav/calendar/$uid.ics]

        set updatedIcalText [dict get $d body]
        aa_log "Retrieved modified ical text:<pre>\n[::aa_test::visualize_control_chars $updatedIcalText]</pre>"
        aa_equals "updated Ical valid" [::caldav::test::ical_valid $updatedIcalText""

        set ulocation      [::caldav::test::ical_extract $updatedIcalText LOCATION]
        set ulast_modified [::caldav::test::ical_extract $updatedIcalText LAST-MODIFIED]

        set alarm_uid      [::caldav::test::ical_extract $updatedIcalText X-WR-ALARMUID]
        set structured_loc [::caldav::test::ical_extract $updatedIcalText X-APPLE-STRUCTURED-LOCATION]

        aa_equals "location preserved"    $mlocation $ulocation
        aa_true   "last_modified updated" {$mlast_modified ne $ulast_modified}
        aa_true   "alarm_uid not empty"   {$alarm_uid ne ""}
        set len   [string length $structured_loc]
        aa_true   "structured_locaction not empty (len $len)" {$len > 10}


    } 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_location (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: