1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 22:19:38 +00:00
fhem-mirror/t/FHEM/70_BOTVAC/CommandSet.t
2020-09-20 15:33:59 +00:00

42 lines
1.2 KiB
Perl

################################################
# test Set
################################################
package FHEM::BOTVAC;
use strict;
use warnings;
use Test::More;
# used to import of FHEM functions from fhem.pl
use GPUtils qw(:all);
BEGIN {
GP_Import(
qw(
fhem
FhemTestUtils_gotLog
)
);
}
# trigger without argument
fhem('set botvac');
is(FhemTestUtils_gotLog('set botvac : No Argument given'), 1, 'Match: No Argument given');
# trigger with unknown argument
fhem('set botvac missing');
is( FhemTestUtils_gotLog('set botvac missing : Unknown argument missing, choose one of password statusRequest:noArg schedule:on,off syncRobots:noArg pollingMode:on,off'),
1, 'Match: Unknown argument missing' );
# trigger preferences
fhem('setreading botvac pref_filterChangeReminderInterval 3');
fhem('setreading botvac .secretKey testing');
fhem('set botvac filterChangeReminderInterval 1');
is( FhemTestUtils_gotLog('REQ messages/setPreferences'),
1, 'Match: REQ messages/setPreferences' );
is( FhemTestUtils_gotLog('REQ option {"filterChangeReminderInterval":43200}'),
1, 'Match: REQ option {"filterChangeReminderInterval":43200}' );
done_testing;
exit(0);
1;