Commit 83cb8b5f authored by André Anjos's avatar André Anjos 💬
Browse files

[test] Test meta data creation

parent c4b4f171
......@@ -8,6 +8,7 @@
import os, sys
import unittest
import nose.tools
import pkg_resources
from . import Database
......@@ -102,6 +103,27 @@ class HCITaggingTest(unittest.TestCase):
assert hr
@nose.tools.nottest
@db_available
def test05_can_write_meta(self):
import matplotlib.pyplot as plt
from .utils import bdf_load_signal, plot_signal
for obj in self.db.objects()[:1]:
#if obj.stem.find('Part_1_') < 0: continue
estimates = []
for i, channel in enumerate(('EXG1', 'EXG2', 'EXG3')):
plt.subplot(3, 1, i+1)
signal_file = obj.make_path(DATABASE_LOCATION)
signal, freq = bdf_load_signal(signal_file, channel)
avg_hr, peaks = plot_signal(signal, freq, channel)
estimates.append(avg_hr)
plt.tight_layout()
plt.show()
class CmdLineTest(unittest.TestCase):
"""Makes sure our command-line is working properly."""
......
......@@ -166,6 +166,7 @@ def plot_signal(s, sampling_frequency, channel_name):
float: The estimated average heart-rate in beats-per-minute
'''
import matplotlib.pyplot as plt
avg, peaks = estimate_average_heartrate(s, sampling_frequency)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment