Exemple #1
0
 def standard_dmp(self, source, target, format, filters=None):
     with self.assertTextMatch(target, filters=filters) as output:
         summarize(format,
                   read_fit(log, source),
                   warn=True,
                   profile_path=self.profile_path,
                   output=output)
Exemple #2
0
 def test_drop(self):
     bad = read_fit(join(self.test_dir, 'source/other/8CS90646.FIT'))
     fixed = fix(bad, drop=True, fix_checksum=True, fix_header=True)
     self.assertTrue(len(fixed) < len(bad))
     with self.assertTextMatch(
             'data/test/target/other/TestFixFit.test_drop') as output:
         summarize(RECORDS, fixed, output=output)
Exemple #3
0
 def test_other_bad(self):
     bad = read_fit(join(self.test_dir, 'source/other/2018-04-15-09-18-20.fit'))
     fixed = fix(bytearray(bad), drop=True, fix_checksum=True, fix_header=True)
     with self.assertTextMatch(join(self.test_dir, 'target/other/TestFixFit.test_unknown_bad:1')) as output:
         summarize(RECORDS, fixed, output=output)
     bad = read_fit(join(self.test_dir, 'source/other/2018-02-24-10-04-10.fit'))
     fixed = fix(bytearray(bad), drop=True, fix_checksum=True, fix_header=True)
     with self.assertTextMatch(join(self.test_dir, 'target/other/TestFixFit.test_unknown_bad:2')) as output:
         summarize(RECORDS, fixed, output=output)
Exemple #4
0
 def test_developer(self):
     with self.assertTextMatch(
             join(self.test_dir,
                  'target/sdk/TestFit.test_developer')) as output:
         summarize(FIELDS,
                   read_fit(
                       join(self.test_dir, 'source/sdk/DeveloperData.fit')),
                   profile_path=self.profile_path,
                   width=80,
                   output=output)
Exemple #5
0
 def test_dump(self):
     with self.assertTextMatch(
             join(self.test_dir,
                  'target/personal/TestFit.test_dump')) as output:
         summarize(FIELDS,
                   read_fit(
                       join(self.test_dir,
                            'source/personal/2018-07-30-rec.fit')),
                   profile_path=self.profile_path,
                   width=80,
                   output=output)
Exemple #6
0
 def test_grep(self):
     data = read_fit(
         log, join(self.test_dir, 'source/personal/2018-07-26-rec.fit'))
     summarize(GREP, data, grep=['.*:.*speed>10'])