From d2853bdb0e7753af44c4efc1df9e98d4cfa6e54b Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Tue, 30 Jul 2013 20:35:54 -0400 Subject: [PATCH] Add test case for bad trainola detections --- Makefile | 13 ++++++++--- extras/trainola-test-param-3.js | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 extras/trainola-test-param-3.js diff --git a/Makefile b/Makefile index 6f976fd..9df9e12 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ else @echo "Try 'make install'" endif -test: test_insert +test: test_trainola3 test_pipewatch: nilmtools/pipewatch.py -t 3 "seq 10 20" "seq 20 30" @@ -16,11 +16,18 @@ test_pipewatch: test_trainola: -nilmtool -u http://bucket/nilmdb remove -s min -e max \ /sharon/prep-a-matches - nilmtools/trainola.py "$$(cat extras/trainola-test-param-2.js)" + nilmtools/trainola.py "$$(cat extras/trainola-test-param.js)" + +test_trainola2: -nilmtool -u http://bucket/nilmdb remove -s min -e max \ /sharon/prep-a-matches - nilmtools/trainola.py "$$(cat extras/trainola-test-param.js)" + nilmtools/trainola.py "$$(cat extras/trainola-test-param-2.js)" +test_trainola3: + -nilmtool -u "http://bucket/nilmdb" destroy -R /test/jim + nilmtool -u "http://bucket/nilmdb" create /test/jim uint8_3 + nilmtools/trainola.py "$$(cat extras/trainola-test-param-3.js)" + nilmtool -u "http://bucket/nilmdb" extract /test/jim -s min -e max test_cleanup: nilmtools/cleanup.py -e extras/cleanup.cfg diff --git a/extras/trainola-test-param-3.js b/extras/trainola-test-param-3.js new file mode 100644 index 0000000..aebe963 --- /dev/null +++ b/extras/trainola-test-param-3.js @@ -0,0 +1,40 @@ +{ + "url": "http://bucket/nilmdb", + "stream": "/sharon/prep-a", + "dest_stream": "/test/jim", + "start": 1364184839901599, + "end": 1364184942407610.2, + + "columns": [ { "index": 0, "name": "P1" } ], + + "exemplars": [ + { + "name": "A - True DBL Freezer ON", + "dest_column": 0, + "url": "http://bucket/nilmdb", + "stream": "/sharon/prep-a", + "columns": [ { "index": 0, "name": "P1" } ], + "start": 1365277707649000, + "end": 1365277710705000 + }, + { + "name": "A - Boiler 1 Fan OFF", + "dest_column": 1, + "url": "http://bucket/nilmdb", + "stream": "/sharon/prep-a", + "columns": [ { "index": 0, "name": "P1" } ], + "start": 1364188370735000, + "end": 1364188373819000 + }, + { + "name": "A - True DBL Freezer OFF", + "dest_column": 2, + "url": "http://bucket/nilmdb", + "stream": "/sharon/prep-a", + "columns": [ { "index": 0, "name": "P1" } ], + "start": 1365278087982000, + "end": 1365278089340000 + } + ] +} +