# HG changeset patch # User Paul Boddie # Date 1516289903 -3600 # Node ID a646c10067e6c37c734e3c2112ef082551bbe57d # Parent 02d8d279f84a9b13a1304443be52467b754616b2 Introduced helper functions to test initial free/busy state. diff -r 02d8d279f84a -r a646c10067e6 tests/common.sh --- a/tests/common.sh Tue Jan 16 23:29:39 2018 +0100 +++ b/tests/common.sh Thu Jan 18 16:38:23 2018 +0100 @@ -134,6 +134,26 @@ fi } +test_initial_freebusy() { + person_script "$TEMPLATES/fb-request-person-all.txt" "init_fb.tmp" + + # Expect a reply with no periods. + + is_present 'METHOD:REPLY' "init_fb.tmp" \ + && is_absent '^FREEBUSY' "init_fb.tmp" \ + && success || failed "init_fb.tmp" +} + +test_initial_freebusy_limited() { + person_script "$TEMPLATES/fb-request-person.txt" "init_fb_limited.tmp" + + # Expect a reply with no periods. + + is_present 'METHOD:REPLY' "init_fb_limited.tmp" \ + && is_absent '^FREEBUSY' "init_fb_limited.tmp" \ + && success || failed "init_fb_limited.tmp" +} + # Test environment initialisation. diff -r 02d8d279f84a -r a646c10067e6 tests/test_person_invitation.sh --- a/tests/test_person_invitation.sh Tue Jan 16 23:29:39 2018 +0100 +++ b/tests/test_person_invitation.sh Thu Jan 18 16:38:23 2018 +0100 @@ -9,25 +9,10 @@ echo 'Europe/Oslo' > "$PREFS/$USER/TZID" echo 'share' > "$PREFS/$USER/freebusy_sharing" -# Present a free/busy request for all periods to the recipient. - -person_script "$TEMPLATES/fb-request-person-all.txt" "out0.tmp" - -# Expect a reply with no periods. - - is_present 'METHOD:REPLY' "out0.tmp" \ -&& is_absent '^FREEBUSY' "out0.tmp" \ -&& success || failed "out0.tmp" +# Test the recipient's initial free/busy state. -# Present a free/busy request for periods of interest to the recipient. - -person_script "$TEMPLATES/fb-request-person.txt" "out1.tmp" - -# Expect a reply with no periods. - - is_present 'METHOD:REPLY' "out1.tmp" \ -&& is_absent '^FREEBUSY' "out1.tmp" \ -&& success || failed "out1.tmp" +test_initial_freebusy +test_initial_freebusy_limited # Make a new event. diff -r 02d8d279f84a -r a646c10067e6 tests/test_person_invitation_counter.sh --- a/tests/test_person_invitation_counter.sh Tue Jan 16 23:29:39 2018 +0100 +++ b/tests/test_person_invitation_counter.sh Thu Jan 18 16:38:23 2018 +0100 @@ -12,11 +12,9 @@ echo 'share' > "$PREFS/$USER/freebusy_sharing" echo 'PT60S' > "$PREFS/$USER/freebusy_offers" -person_script "$TEMPLATES/fb-request-person-all.txt" "out0.tmp" +# Test the recipient's initial free/busy state. - is_present 'METHOD:REPLY' "out0.tmp" \ -&& is_absent '^FREEBUSY' "out0.tmp" \ -&& success || failed "out0.tmp" +test_initial_freebusy # Make a new event.