shlist

share and manage lists between multiple people
Log | Files | Refs

commit aeabc3d2a7cff0a1ca8e1b3861cefc2f7ab07983
parent 3b12f77ff08920cc16a382418c0b4b5173ea4d1f
Author: Kyle Milz <kyle@0x30.net>
Date:   Sun, 24 Jan 2016 20:34:40 -0700

tests: simplify arguments to device_add

Diffstat:
Mserver/tests/client.pm | 7++-----
Mserver/tests/device_add/test.pl | 10+++++-----
2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/server/tests/client.pm b/server/tests/client.pm @@ -32,7 +32,7 @@ sub new { # Register this device immediately by default if ($dont_register == 0) { - $self->device_add(rand_phnum()); + $self->device_add({ phone_number => rand_phnum(), os => 'unix' }); } return $self; @@ -123,10 +123,7 @@ sub lists_get_other { sub device_add { my $self = shift; - my $msg_args = { - phone_number => shift || '4038675309', - os => shift || 'unix' - }; + my $msg_args = shift; my $exp_status = shift || 'ok'; # Reset error messages to guard against stale state diff --git a/server/tests/device_add/test.pl b/server/tests/device_add/test.pl @@ -13,17 +13,17 @@ fail "device id '$devid' not base64" unless ($devid =~ m/^[a-zA-Z0-9+\/=]+$/); fail "expected device id length of 43, got $length" if ($length != 43); # Duplicate phone number -$A->device_add($A->phnum, 'unix', 'err'); +$A->device_add({ phone_number => $A->phnum, os => 'unix' }, 'err'); fail_msg_ne 'the sent phone number already exists', $A->get_error(); # Bad phone number -$A->device_add('403867530&', 'unix', 'err'); +$A->device_add({ phone_number => '403867530&', os => 'unix' }, 'err'); fail_msg_ne 'the sent phone number is not a number', $A->get_error(); # Bad operating system -$A->device_add(rand_phnum(), 'bados', 'err'); +$A->device_add({ phone_number => rand_phnum(), os => 'bados' }, 'err'); fail_msg_ne 'operating system not supported', $A->get_error(); # Good operating systems -$A->device_add(rand_phnum(), 'android'); -$A->device_add(rand_phnum(), 'ios'); +$A->device_add({ phone_number => rand_phnum(), os => 'android' }); +$A->device_add({ phone_number => rand_phnum(), os => 'ios' });