Exemplo n.º 1
0
 def test_decode(self):
     types, messages, records = \
         filtered_records(read_fit(join(self.test_dir, 'source/personal/2018-07-26-rec.fit')),
                          profile_path=self.profile_path)
     with self.assertTextMatch(join(self.test_dir, 'target/personal/TestFit.test_decode'),
                               filters=[HEX_ADDRESS]) as output:
         for _, _, record in records:
             print(record.into(tuple, filter=chain(no_names, append_units, no_bad_values, fix_degrees)),
                   file=output)
Exemplo n.º 2
0
 def test_timestamp_16(self):
     types, messages, records = \
         filtered_records(read_fit(join(self.test_dir, 'source/personal/[email protected]_24755630065.fit')),
                          profile_path=self.profile_path)
     with self.assertTextMatch(join(self.test_dir, 'target/personal/TestFit.test_timestamp_16'),
                               filters=[HEX_ADDRESS]) as output:
         for _, _, record in records:
             if record.name == 'monitoring':
                 print(record.into(tuple, filter=chain(no_names, append_units, no_bad_values, fix_degrees)),
                       file=output)
Exemplo n.º 3
0
 def test_date16(self):
     data = read_fit('data/test/source/other/38014592427.fit')
     # types, messages, records = filtered_records(data, after_records=2342)
     types, messages, records = filtered_records(data)
     previous = None
     for (a, b, record) in records:
         if 'timestamp' in record._fields:
             if previous and previous > record.timestamp:
                 # we have time-travel of 1 minute in this data
                 self.assertTrue(previous - record.timestamp < dt.timedelta(minutes=2),
                                 f'{previous} -> {record.timestamp}')
             previous = record.timestamp