"
set result [util_remove_html_tags $html]
- aa_true "Without all between \"<\" and \">\" html=\"$result\""\
- [string equal "some text to probe if it remove all between \"\"" $result]
+ aa_equals "Without all between \"<\" and \">\" html=\"$result\""\
+ "some text to probe if it remove all between \"\"" $result
}
-aa_register_case -cats {api smoke} -procs {ad_parse_html_attributes} ad_parse_html_attributes {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {ad_parse_html_attributes} \
+ ad_parse_html_attributes {
Test if returns a list of attributes inside an HTML tag
} {
set pos 5
@@ -270,8 +303,11 @@
aa_equals "Attributes - $result" $result {{foo bar} {greeting {welcome home}} {ja blah}}
}
-aa_register_case -cats {api smoke} -procs {ad_html_text_convert} ad_text_html_convert_outlook_word_comments {
- Test is MS Word HTML Comments are stripped or not
+aa_register_case \
+ -cats {api smoke} \
+ -procs {ad_html_text_convert} \
+ ad_text_html_convert_outlook_word_comments {
+ Test whether HTML comments inserted by MS Word are stripped
} {
set html {}
@@ -316,7 +352,10 @@
}
-aa_register_case -cats {api smoke} -procs {ad_html_text_convert} ad_text_html_convert_to_plain {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {ad_html_text_convert} \
+ ad_text_html_convert_to_plain {
Test rendering of a more or less standard HTML text
} {
@@ -393,10 +432,116 @@
[string first { This is *bold} $result] > 0
}
+}
+aa_register_case \
+ -cats {api} \
+ -bugs 1450 \
+ -procs {ad_enhanced_text_to_html} \
+ acs_tcl__process_enhanced_correctly {
+
+ Process sample text correctly
+ @author Nima Mazloumi
+ } {
+
+ set string_with_img {
}
+ aa_log "Original string is $string_with_img"
+ set html_version [ad_enhanced_text_to_html $string_with_img]
+ aa_equals "new: $html_version should be the same" $html_version $string_with_img
+}
+aa_register_case \
+ -cats {api smoke} \
+ -procs {ad_html_to_text} \
+ text_to_html {
+
+ Test code the supposedly causes ad_html_to_text to break
+} {
+
+ # Test bad <<<'s
+
+ set offending_post {><<<}
+ set errno [catch { set text_version [ad_html_to_text -- $offending_post] } errmsg]
+
+ if { ![aa_equals "Does not bomb" $errno 0] } {
+ aa_log "errmsg: $errmsg"
+ aa_log "errorInfo: $::errorInfo"
+ } else {
+ aa_equals "Expected identical result" $text_version $offending_post
+ }
+
+ # Test offending post sent by Dave Bauer
+
+ set offending_post {
+I have a dynamically assigned ip address, so I use dyndns.org to
+change
+addresses for my acs server.
+Mail is sent to any yahoo address fine. Mail sent to aol fails. I am
+not running a dns server on my acs box. What do I need to do to
+correct this problem?
+Here's my error message:
+ Mail Delivery Subsystem
+ | Block
+ Address | Add to Address Book
+ To:
+ gmt3rd@yahoo.com
+ Subject:
+ Returned mail: Service unavailable
+
+
+
+The original message was received at Sat, 17 Mar 2001 11:48:57 -0500
+from IDENT:nsadmin@localhost [127.0.0.1]
+
+ ----- The following addresses had permanent fatal errors -----
+gmt3rd@aol.com
+
+ ----- Transcript of session follows -----
+... while talking to mailin-04.mx.aol.com.:
+<<< 550-AOL no longer accepts connections from dynamically assigned
+<<< 550-IP addresses to our relay servers. Please contact your ISP
+<<< 550 to have your mail redirected through your ISP's SMTP servers.
+... while talking to mailin-02.mx.aol.com.:
+>>> QUIT
+
+
+ Attachment: Message/delivery-status
+
+Reporting-MTA: dns; testdsl.homeip.net
+Received-From-MTA: DNS; localhost
+Arrival-Date: Sat, 17 Mar 2001 11:48:57 -0500
+
+Final-Recipient: RFC822; gmt3rd@aol.com
+Action: failed
+Status: 5.5.0
+Remote-MTA: DNS; mailin-01.mx.aol.com
+Diagnostic-Code: SMTP; 550-AOL no longer accepts connections from
+dynamically assigned
+Last-Attempt-Date: Sat, 17 Mar 2001 11:48:57 -0500
+
+
+
+anybody have any ideas?
+ }
+
+ set errno [catch { set text_version [ad_html_to_text -- $offending_post] } errmsg]
+
+ if { ![aa_equals "Does not bomb" $errno 0] } {
+ aa_log "errmsg: $errmsg"
+ aa_log "errorInfo: $::errorInfo"
+ } else {
+ aa_log "Text version: $text_version"
+ }
+
+ # Test placement of [1] reference
+ set html {Here is http://openacs.org my friend}
+
+ set text_version [ad_html_to_text -- $html]
+
+ aa_log "Text version: $text_version"
}
+
# Local variables:
# mode: tcl
# tcl-indent-level: 4
Index: openacs-4/packages/acs-tcl/tcl/test/html-email-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/html-email-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/tcl/test/html-email-procs.tcl 27 Mar 2018 11:18:00 -0000 1.4
+++ openacs-4/packages/acs-tcl/tcl/test/html-email-procs.tcl 25 Jul 2018 13:42:48 -0000 1.5
@@ -2,7 +2,10 @@
Test html email procs
}
-aa_register_case -cats {api smoke} build_mime_message {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {build_mime_message} \
+ build_mime_message {
Basic test of build mime message
} {
aa_false "Build mime message, no error" \
Index: openacs-4/packages/acs-tcl/tcl/test/memoizing-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/memoizing-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-tcl/tcl/test/memoizing-procs.tcl 7 Aug 2017 23:48:00 -0000 1.3
+++ openacs-4/packages/acs-tcl/tcl/test/memoizing-procs.tcl 25 Jul 2018 13:42:48 -0000 1.4
@@ -28,7 +28,10 @@
return $response
}
-aa_register_case -cats {api smoke} ad_proc_cache {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {util_memoize util_memoize_cached_p} \
+ util_memoize_cache {
Test cache of a proc executed before
} {
aa_log "caching a proc"
@@ -39,7 +42,10 @@
aa_equals "proc was cached successful" $success_p 1
}
-aa_register_case -cats {api smoke} ad_proc_flush {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {util_memoize util_memoize_cached_p util_memoize_flush_regexp} \
+ util_memoize_cache_flush {
Test flush of a proc cached
} {
aa_log "caching"
Index: openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl 25 Jul 2018 02:51:32 -0000 1.11
+++ openacs-4/packages/acs-tcl/tcl/test/navigation-procs.tcl 25 Jul 2018 13:42:48 -0000 1.12
@@ -43,17 +43,14 @@
}
-aa_register_case -cats {
- api
- smoke
-} -procs {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {
+ ad_context_bar_html
+ } ad_context_bar_html {
- ad_context_bar_html
+ Test if returns a HTML fragment from a list.
-} ad_context_bar_html {
-
- Test if returns a html fragment from a list.
-
} {
set ref_list [list [list "/doc/doc0.html" "href0"] [list "/doc/doc1.html" "href1"] [list "/doc/doc2.html" "href2"]]
@@ -62,8 +59,8 @@
set separator "-"
aa_log "List with three references:\n\n$c\nseparator= \" - \" "
- aa_equals "" [ad_context_bar_html -separator $separator $ref_list] "[lindex $ref_list 0 1] - [lindex $ref_list 1 1] - [lindex $ref_list 2 0] [lindex $ref_list 2 1]"
-
+ aa_equals "" [ad_context_bar_html -separator $separator $ref_list] \
+ "[lindex $ref_list 0 1] - [lindex $ref_list 1 1] - [lindex $ref_list 2 0] [lindex $ref_list 2 1]"
}
aa_register_case -cats {
@@ -76,7 +73,7 @@
site_node::new
} ad_context_bar {
- Test if returns a well formed context_bar in html format from a site node.
+ Test if returns a well formed context_bar in HTML format from a site node.
} {
@@ -100,7 +97,7 @@
# Create hierarchy from the random created nodes
db_1row query {
- select MIN(node_id) as first_node from site_nodes
+ select min(node_id) as first_node from site_nodes
}
set idp $first_node
set idr_1 [site_node::new -name $random1 -parent_id $idp]
@@ -129,12 +126,8 @@
#aa_log "bar_components $bar_components"
set context_barp ""
foreach value $bar_components {
- append context_barp ""
- append context_barp [lindex $value 1]
- append context_barp ""
- append context_barp " $separator "
+ append context_barp \
+ [subst {[lindex $value 1] $separator }]
}
append context_barp "$leave_node"
set context_bar [ad_context_bar -node_id $idr_1 -separator $separator $leave_node]
@@ -150,12 +143,8 @@
set bar_components [list $root_node $testnode_1 $testnode_2 $admin_node]
set context_barp ""
foreach value $bar_components {
- append context_barp ""
- append context_barp [lindex $value 1]
- append context_barp ""
- append context_barp " $separator "
+ append context_barp \
+ [subst {[lindex $value 1] $separator }]
}
append context_barp "$leave_node"
set context_bar [ad_context_bar -node_id $idr_2 -separator $separator $leave_node]
@@ -169,31 +158,25 @@
set bar_components [list $testnode_1 $testnode_2 $admin_node]
set context_barp ""
foreach value $bar_components {
- append context_barp ""
- append context_barp [lindex $value 1]
- append context_barp ""
- append context_barp " $separator "
+ append context_barp \
+ [subst {[lindex $value 1] $separator }]
}
append context_barp "$leave_node"
set context_bar [ad_context_bar -from_node $idr_1 -node_id $idr_2 -separator $separator $leave_node]
aa_equals "Context_bar = $context_barp" $context_bar $context_barp
}
}
-aa_register_case -cats {
- api
- smoke
- web
-} -libraries tclwebtest -procs {
+aa_register_case \
+ -cats {api smoke web} \
+ -libraries tclwebtest \
+ -procs {
+ ad_context_bar_multirow
+ } \
+ ad_context_bar_multirow {
- ad_context_bar_multirow
-
-} ad_context_bar_multirow {
+ Test if returns a well formed context_bar in HTML format from a site node in a multirow.
- Test if returns a well formed context_bar in html format from a site node in a multirow.
-
} {
# Setup nodes from the context bar, create two nodes to include
set separator ""
Index: openacs-4/packages/acs-tcl/tcl/test/object-test-case-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/object-test-case-procs.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/acs-tcl/tcl/test/object-test-case-procs.tcl 7 Aug 2017 23:48:00 -0000 1.7
+++ openacs-4/packages/acs-tcl/tcl/test/object-test-case-procs.tcl 25 Jul 2018 13:42:48 -0000 1.8
@@ -1,19 +1,17 @@
-#
-
ad_library {
-
-
@author byron Haroldo Linares Roman (bhlr@galileo.edu)
@creation-date 2006-08-11
- @arch-tag: E1207E78-A4E3-4DC7-BEB7-49EA35B99D69
@cvs-id $Id$
}
aa_register_case \
-cats {api smoke} \
- -procs {acs_object::get acs_object::get_element acs_object::set_context_id} \
- acs_object_procs_test \
+ -procs {
+ acs_object::get
+ acs_object::get_element
+ acs_object::set_context_id
+ } acs_object_procs_test \
{
test the acs_object::* procs
} {
Index: openacs-4/packages/acs-tcl/tcl/test/openacs-kernel-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/openacs-kernel-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-tcl/tcl/test/openacs-kernel-procs.tcl 7 Aug 2017 23:48:00 -0000 1.3
+++ openacs-4/packages/acs-tcl/tcl/test/openacs-kernel-procs.tcl 25 Jul 2018 13:42:48 -0000 1.4
@@ -3,7 +3,10 @@
@creation-date 03 August 2006
}
-aa_register_case -cats {api smoke} -procs {oacs_util::csv_foreach} csv_foreach {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {oacs_util::csv_foreach} \
+ csv_foreach {
Test block execution for rows in a csv file.
} {
aa_run_with_teardown -test_code {
@@ -24,21 +27,26 @@
aa_log "CSV file created with artists data:\n $csv_data"
set artist_list {}
- oacs_util::csv_foreach -file $file_loc -array_name row\
- {
- lappend artist_list "$row(first_name) $row(last_name) - $row(instrument)"
- }
+ oacs_util::csv_foreach -file $file_loc -array_name row {
+ lappend artist_list "$row(first_name) $row(last_name) - $row(instrument)"
+ }
aa_equals "Getting artists from csv file" $artist_list {{Charles Mingus - Bass}\
- {Miles Davis - Trumpet}\
- {Jhon Coltrane - Saxo}\
- {Charlie Parker - Saxo}\
- {Thelonius Monk - Piano}}
+ {Miles Davis - Trumpet}\
+ {Jhon Coltrane - Saxo}\
+ {Charlie Parker - Saxo}\
+ {Thelonius Monk - Piano}}
} -teardown_code {
file delete -force -- $file_loc
}
}
-aa_register_case -cats {api smoke} -procs {oacs_util::process_objects_csv} process_objects_csv {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {
+ oacs_util::process_objects_csv
+ person::get
+ } \
+ process_objects_csv {
Test object creation for every row in a csv file.
} {
aa_run_with_teardown -rollback -test_code {
@@ -66,8 +74,8 @@
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}}
+ {Miles Davis}\
+ {Charlie Parker}}
} -teardown_code {
file delete -force -- $file_loc
}
Index: openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl 22 Jul 2018 09:58:43 -0000 1.4
+++ openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl 25 Jul 2018 13:42:48 -0000 1.5
@@ -4,20 +4,31 @@
@author Cesar Hernandez (cesarhj@galileo.edu)
@creation-date 2006-07-31
- @arch-tag: 92464550-0231-4D33-8885-595623B00DB6
@cvs-id $Id$
}
-aa_register_case -cats {api smoke} ad_proc_change_state_member {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {
+ acs_user::get
+ membership_rel::approve
+ membership_rel::ban
+ membership_rel::delete
+ membership_rel::reject
+ membership_rel::unapprove
+ } \
+ ad_proc_change_state_member {
Test the proc change_state
} {
- #we get a user_id as party_id
- set user_id [db_nextval acs_object_id_seq]
aa_run_with_teardown -rollback -test_code {
+
+ #we get a user_id as party_id
+ set user_id [db_nextval acs_object_id_seq]
+
#Create the user
- array set user_info [twt::user::create -user_id $user_id]
+ set user_info [acs::test::user::create -user_id $user_id]
set rel_id [db_string get_rel_id "select max(rel_id) from acs_rels where object_id_two = :user_id" -default 0]
#Try to change his state to approved
@@ -26,7 +37,7 @@
acs_user::get -user_id $user_id -array user
#Verifying if the state was changed
- aa_equals "Changed State to aprroved" \
+ aa_equals "Changed State to aprroved" \
$user(member_state) "approved"
@@ -36,7 +47,7 @@
acs_user::get -user_id $user_id -array user
#Verifying if the state was changed
- aa_equals "Changed State to banned" \
+ aa_equals "Changed State to banned" \
$user(member_state) "banned"
@@ -46,7 +57,7 @@
acs_user::get -user_id $user_id -array user
#Verifying if the state was changed
- aa_equals "Changed State to rejected" \
+ aa_equals "Changed State to rejected" \
$user(member_state) "rejected"
@@ -65,10 +76,8 @@
acs_user::get -user_id $user_id -array user
#Verifying if the state was changed
- aa_equals "Changed State to deleted" \
+ aa_equals "Changed State to deleted" \
$user(member_state) "deleted"
-
-
}
}
# Local variables:
Index: openacs-4/packages/acs-tcl/tcl/test/test-permissions-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/test-permissions-procs.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-tcl/tcl/test/test-permissions-procs.tcl 19 Jul 2018 11:43:19 -0000 1.5
+++ openacs-4/packages/acs-tcl/tcl/test/test-permissions-procs.tcl 25 Jul 2018 13:42:48 -0000 1.6
@@ -1,25 +1,32 @@
-#
-
ad_library {
Test for Permission Procedures
@author Cesar Hernandez (cesarhj@galileo.edu)
@creation-date 2006-07-14
- @arch-tag: 0823E65B-D0B0-417A-AB6F-CA86E0461A8E
@cvs-id $Id$
}
-aa_register_case -cats {api smoke} ad_proc_permission_grant_and_revoke {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {
+ permission::grant
+ permission::permission_p
+ permission::revoke
+ site_node::instantiate_and_mount
+ } \
+ ad_proc_permission_grant_and_revoke {
- Test for Permission Procedures of grant and revoke.
+ Test for permission procedures of grant and revoke.
} {
- # We get an user_id as party_id.
- set user_id [db_nextval acs_object_id_seq]
aa_run_with_teardown -rollback -test_code {
+ # We get an user_id as party_id.
+ set user_id [db_nextval acs_object_id_seq]
+
# Create the user
- array set user_info [twt::user::create -user_id $user_id]
+ set user_info [acs::test::user::create -user_id $user_id]
+
# Create and mount new subsite to test the permissions on this
# instance.
set site_name [ad_generate_random_string]
@@ -82,16 +89,26 @@
}
}
-aa_register_case -cats {api smoke} ad_proc_permission_permission_p {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {
+ permission::grant
+ permission::permission_p
+ permission::revoke
+ site_node::instantiate_and_mount
+ } \
+ ad_proc_permission_permission_p {
Test for Permission Procedures of permission_p
} {
- # We get an user_id as party_id.
- set user_id [db_nextval acs_object_id_seq]
aa_run_with_teardown -rollback -test_code {
+ # We get an user_id as party_id.
+ set user_id [db_nextval acs_object_id_seq]
+
# Create the user
- array set user_info [twt::user::create -user_id $user_id]
+ set user_info [twt::user::create -user_id $user_id]
+
# Create and mount new subsite to test the permissions on this
# instance
set site_name [ad_generate_random_string]
Index: openacs-4/packages/acs-tcl/tcl/test/test-set-cookie-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/test-set-cookie-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/tcl/test/test-set-cookie-procs.tcl 22 Jul 2018 09:58:43 -0000 1.4
+++ openacs-4/packages/acs-tcl/tcl/test/test-set-cookie-procs.tcl 25 Jul 2018 13:42:48 -0000 1.5
@@ -1,17 +1,19 @@
-#/packages/acs-tcl/tcl/test
-
ad_library {
Test Case for set_cookie procs
@author Cesar Hernandez (cesarhj@galileo.edu)
@creation-date 2006-08-10
- @arch-tag: 0AA7362F-83FF-4067-B391-A2F8D6918F3E
@cvs-id $Id$
}
aa_register_case \
-cats {web smoke} \
+ -procs {
+ ad_get_cookie
+ ad_set_cookie
+ ad_set_signed_cookie
+ } \
test_set_cookie_procs \
{
Test Case for testing if a cookie is fixed
@@ -72,9 +74,12 @@
}
}
-
aa_register_case \
-cats {web smoke} \
+ -procs {
+ ad_get_client_property
+ ad_set_client_property
+ } \
client_properties \
{
Test Case client properties
Index: openacs-4/packages/acs-tcl/tcl/test/text-html-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/text-html-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/acs-tcl/tcl/test/text-html-procs.tcl 4 Jul 2018 22:22:44 -0000 1.6
+++ openacs-4/packages/acs-tcl/tcl/test/text-html-procs.tcl 25 Jul 2018 13:42:48 -0000 1.7
@@ -6,7 +6,10 @@
}
-aa_register_case -cats {api smoke} ad_dom_sanitize_html {
+aa_register_case \
+ -cats {web api smoke} \
+ -procs {ad_dom_sanitize_html} \
+ ad_dom_sanitize_html {
Test if it HTML sanitization works as expected
@@ -107,7 +110,7 @@
aa_true "$msg no js?" {$result eq $test_result}
}
- # Try test cases not allowing outer urls
+ # Try test cases not allowing outer URLs
foreach \
msg $test_msgs \
test_case $test_cases \
@@ -136,28 +139,11 @@
set test_result [string trim $test_result]
aa_true "$msg fixing markup?" {$result eq $test_result}
}
+
+ set d [acs::test::http /]
+ aa_equals "Start page of current server: Status code valid" [dict get $d status] 200
- #
- # Maybe a temporary fix: when the server is configured with a
- # wildcard IPv4 address 0.0.0.0 and the hostname "localhost", and
- # localhost is mapped on the host to the IPv6 address "::1", then
- # ns_http to http://localhost:.../ is rejected, while the
- # connection to the current IPv4 address http://127.0.0.1:.../
- # succeeds. However, the determination of the current IP address
- # requires NaviServer 4.99.17d3 or newer, so we can't assume, this
- # works always.
- #
- set mylocation [util::configured_location]/
- if {![catch {set myip [ns_conn currentaddr]}]} {
- set driver_info [util_driver_info]
- set mylocation [util::join_location \
- -proto [dict get $driver_info proto] \
- -hostname $myip \
- -port [dict get $driver_info port]]
- }
- aa_log "trying to get start page from $mylocation"
- array set r [util::http::get -url $mylocation]
- set test_case $r(page)
+ set test_case [dict get $d body]
set msg "Test case 6: in our index page is removing tags ok"
set unallowed_tags {div style script}
@@ -224,7 +210,10 @@
}
-aa_register_case -cats {api smoke} ad_pad {
+aa_register_case \
+ -cats {api smoke} \
+ -procs {ad_pad} \
+ ad_pad {
Test if ad_pad is working as expected
Index: openacs-4/packages/acs-tcl/tcl/test/whos-online-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/whos-online-procs.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/acs-tcl/tcl/test/whos-online-procs.tcl 19 Jul 2018 11:43:19 -0000 1.8
+++ openacs-4/packages/acs-tcl/tcl/test/whos-online-procs.tcl 25 Jul 2018 13:42:48 -0000 1.9
@@ -5,17 +5,18 @@
@creation-date 2006-08-02
}
-aa_register_case -cats {
- smoke production_safe web
-} -libraries tclwebtest -procs {
- whos_online::num_users
- whos_online::set_invisible
- whos_online::all_invisible_user_ids
- whos_online::unset_invisible
- whos_online::user_ids
-} whos_online__check_online_visibility {
- Check procs related with users online visibility
-} {
+aa_register_case \
+ -cats { smoke production_safe web } \
+ -procs {
+ whos_online::num_users
+ whos_online::set_invisible
+ whos_online::all_invisible_user_ids
+ whos_online::unset_invisible
+ whos_online::user_ids
+ } whos_online__check_online_visibility {
+
+ Check procs related with users online visibility
+ } {
set user_id [db_nextval acs_object_id_seq]
@@ -29,52 +30,51 @@
aa_log "Logged users: $logged_users"
# Login user
- array set user_info [twt::user::create -admin -user_id $user_id]
- twt::user::login $user_info(email) $user_info(password)
-
+ set user_info [acs::test::user::create -admin -user_id $user_id]
+
+ set d [acs::test::http -user_id $user_id /]
+
set logged_users [whos_online::num_users]
aa_true "New user logged - Users logged: $logged_users" { $logged_users > 0 }
#---------------------------------------------------------------------------------------------------
#Test set_invisible
#---------------------------------------------------------------------------------------------------
- aa_log "User $user_info(email) is visible"
+ aa_log "User [dict get $user_info email] is visible"
whos_online::set_invisible $user_id
- aa_true "User $user_info(email) is Invisible" {[nsv_exists invisible_users $user_id] == 1 }
+ aa_true "User [dict get $user_info email] is Invisible" {[nsv_exists invisible_users $user_id] == 1 }
#---------------------------------------------------------------------------------------------------
#Test all-invisible_user_ids
#---------------------------------------------------------------------------------------------------
- aa_true "User $user_info(email) with user_id=$user_id is in the invisible list" \
+ aa_true "User [dict get $user_info email] user_id $user_id is in the invisible list ([whos_online::all_invisible_user_ids])" \
{$user_id in [whos_online::all_invisible_user_ids]}
#---------------------------------------------------------------------------------------------------
#Test unset_invisible
#---------------------------------------------------------------------------------------------------
- aa_log "User $user_info(email) is invisible"
+ aa_log "User [dict get $user_info email] is invisible"
whos_online::unset_invisible $user_id
- aa_false "User $user_info(email) is Visible" \
+ aa_false "User [dict get $user_info email] is Visible" \
{[whos_online::user_invisible_p $user_id ] == 1 }
#---------------------------------------------------------------------------------------------------
#Test user_ids
#---------------------------------------------------------------------------------------------------
- aa_true "User $user_info(email) with user_id=$user_id is in the visible list" \
+ aa_true "User [dict get $user_info email] user_id $user_id is in the visible list ([whos_online::user_ids])" \
{$user_id in [whos_online::user_ids]}
- twt::user::logout
- twt::user::delete -user_id $user_id
} -teardown_code {
- twt::user::delete -user_id $user_id
+ acs::test::user::delete -user_id $user_id
}
}