def test_double_partial_adding_b3(self): nmap = NonMetricMap() nmap.update([self.sig1, self.sig2, self.sig3]) nmap.update([self.sig4, self.sig5, self.sig6]) result = nmap.get_space([self.sig1, self.sig2, self.sig3, self.sig6]) self.assertEqual(result[0], 'a')
def test_double_update_second(self): nmap = NonMetricMap() nmap.update([self.sig1, self.sig2, self.sig3]) nmap.update([self.sig4, self.sig5, self.sig6]) result = nmap.get_space([self.sig4, self.sig5, self.sig6]) self.assertEqual(result[0], 'b')
import subprocess import sys import io import datetime # database from tinydb import TinyDB top_database = TinyDB('data/live_mapping.json') database = top_database.table('data') from kalman_filter.sensor.nonmetric_map import NonMetricMap nmap = NonMetricMap(top_database) from kalman_filter.sensor import SensorData def schema_to_db(time: 'datetime.datetime', data): return { 'time': { 'year': time.year, 'month': time.month, 'day': time.day, 'hour': time.hour, 'minute': time.minute, 'second': time.second, 'microsecond': time.microsecond }, 'data': data }
def test_single_partial_missing_a(self): nmap = NonMetricMap() nmap.update([self.sig1, self.sig2, self.sig3]) result = nmap.get_space([self.sig2, self.sig3]) self.assertEqual(result[0], 'a1')