Browse Source

Add nilm-median test, and update for Python 3

tags/nilmtools-2.0.0
Jim Paris 1 year ago
parent
commit
05be240564
1 changed files with 16 additions and 7 deletions
  1. +16
    -7
      tests/test.py

+ 16
- 7
tests/test.py View File

@@ -168,7 +168,7 @@ class CommandTester():

class TestAllCommands(CommandTester):

def load_data(self):
def test_00_load_data(self):
client = nilmdb.client.Client(url=self.url)
client.stream_create("/newton/prep", "float32_8")
client.stream_set_metadata("/newton/prep",
@@ -185,8 +185,6 @@ class TestAllCommands(CommandTester):

client = nilmdb.client.Client(url=self.url)

self.load_data()

# basic arguments
self.fail(f"")
self.fail(f"no-such-src no-such-dest")
@@ -539,11 +537,22 @@ class TestAllCommands(CommandTester):
# so we didn't actually mark anything in this window.
self.ok(f"-c 1 -f 240 -m 50 -e @1234567898010000 /sf/raw /sf/out2")

def test_07_cleanup(self):
self.main = nilmtools.cleanup.main

def test_08_median(self):
def test_07_median(self):
self.main = nilmtools.median.main
client = nilmdb.client.Client(url=self.url)

self.fail(f"")
self.ok(f"--help")

client.stream_create("/median/1", "float32_8")
client.stream_create("/median/2", "float32_8")
self.fail("/newton/prep /median/0")
self.contain("doesn't exist")
self.ok("/newton/prep /median/1")
self.ok("--difference /newton/prep /median/2")

def test_08_cleanup(self):
self.main = nilmtools.cleanup.main

def test_09_trainola(self):
self.main = nilmtools.trainola.main


Loading…
Cancel
Save