fhem-mirror/t/FHEM/98_HTTPMOD/20_extractAllJSON.t
StefanStrobel 9c6e44ed65 98_HTTPMOD: updated tests
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@22692 2b470e98-0d58-463d-a4d8-8e2adae1ed80
2020-08-29 16:18:31 +00:00

28 lines
761 B
Perl

##############################################
# test extractAllReadings
##############################################
use strict;
use warnings;
use Test::More;
eval "use JSON";
if ($@) {
plan skip_all => "This test checks an optional JSON-Feature of HTTPMOD and can only be run with the JSON library installed. Please install JSON Library (apt-get install libjson-perl)";
} else {
plan tests => 3;
}
fhem('set H1 reread');
InternalTimer(time()+1, sub() {
is(FhemTestUtils_gotLog("Read response matched 24"), 1, "Match 24 Readings log");
is(FhemTestUtils_gotEvent("H1:MQTT_ip_1: 168"), 1, "Reading creation 1");
is(FhemTestUtils_gotEvent("H1:modes_2: RainbowChase"), 1, "Reading creation 2");
done_testing;
exit(0);
}, 0);
1;