_calendar__calendar_basic_api (private)

 _calendar__calendar_basic_api

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

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_false aa_false (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) _calendar__calendar_basic_api _calendar__calendar_basic_api _calendar__calendar_basic_api->aa_equals _calendar__calendar_basic_api->aa_false _calendar__calendar_basic_api->aa_log _calendar__calendar_basic_api->aa_log_result _calendar__calendar_basic_api->aa_run_with_teardown

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_run_with_teardown -rollback -test_code {
        #
        # Create test user
        #
        set user_id [db_nextval acs_object_id_seq]
        set user_info [acs::test::user::create -user_id $user_id]
        #
        # Create calendar
        #
        set calendar_name "Test calendar"
        set calendar_id [calendar::new  -owner_id $user_id  -calendar_name $calendar_name]
        aa_true "Calendar exists after creation"  [calendar::exists_p $calendar_id]

        set calendar_dict [calendar::get -calendar_id $calendar_id -array calendar_array]
        aa_equals "Calendar dict and array are returned as expected"  [lsort $calendar_dict] [lsort [array get calendar_array]]
        foreach {v e} [list  calendar_id $calendar_id  calendar_name $calendar_name  owner_id $user_id] {
            aa_equals "Calendar '$v' was returned"  [dict get $calendar_dict $v$e
        }

        calendar::item_type_new -calendar_id $calendar_id -type "Test Item Type"
        aa_true "Item type was generated" [db_0or1row check {
            select item_type_id from cal_item_types where type = 'Test Item Type'
            and calendar_id = :calendar_id
        }]

        aa_equals "Cal item types are retrieved as expected"  [calendar::get_item_types -calendar_id $calendar_id]  [list {{--} {}} {*}[db_list_of_lists select_item_types {
                select type, item_type_id from cal_item_types
                where calendar_id= :calendar_id
            }]]

        calendar::item_type_delete -calendar_id $calendar_id -item_type_id $item_type_id
        aa_false "Item type was deleted" [db_0or1row check {
            select 1 from cal_item_types where item_type_id = :item_type_id
        }]

        #
        # Rename calendar
        #
        aa_equals "Calendar name" [calendar::name $calendar_id"$calendar_name"
        set calendar_name "Test calendar 2"
        calendar::rename -calendar_id $calendar_id -calendar_name $calendar_name
        aa_equals "Calendar name" [calendar::name $calendar_id"$calendar_name"
        #
        # Delete calendar
        #
        calendar::delete -calendar_id $calendar_id
        aa_false "Calendar exists after deletion"  [calendar::exists_p $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" "calendar_basic_api (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: