_acs-tcl__process_objects_csv (private)

 _acs-tcl__process_objects_csv

Defined in packages/acs-tcl/tcl/test/openacs-kernel-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) ad_tmpdir ad_tmpdir (public) _acs-tcl__process_objects_csv _acs-tcl__process_objects_csv _acs-tcl__process_objects_csv->aa_equals _acs-tcl__process_objects_csv->aa_log _acs-tcl__process_objects_csv->aa_log_result _acs-tcl__process_objects_csv->aa_run_with_teardown _acs-tcl__process_objects_csv->ad_tmpdir

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_run_with_teardown -rollback -test_code {

        # Create CSV file of persons
        set file_loc "[ad_tmpdir]/test.csv"
        set file_id [open $file_loc w]
        puts $file_id "email,first_names,last_name"
        puts $file_id "cmingus@foo.bar,Charles,Mingus"
        puts $file_id "mdavis@foo.bar,Miles,Davis"
        puts $file_id "cparker@foo.bar,Charlie,Parker"
        close $file_id

        set csv_data "\nemail,first_names,last_name\ncmingus@foo.bar,Charles,Mingus\nmdavis@foo.bar,Miles,Davis\ncparker@foo.bar,Charlie,Parker"
        aa_log "CSV file for \"person\" objects creation with data:\n $csv_data"

        set person_ids [oacs_util::process_objects_csv -object_type "person" -file $file_loc]

        aa_log "Persons id's created: $person_ids"

        set person_list {}

        foreach person_id $person_ids {
            array set person_array [person::get -person_id $person_id]
            lappend person_list "$person_array(first_names) $person_array(last_name)"
        }
        aa_equals "Getting persons from database table \"persons\"" $person_list {{Charles Mingus} {Miles Davis} {Charlie Parker}}
    } -teardown_code {
        file delete -force -- $file_loc
    }
}} {
          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" "process_objects_csv (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: