Ejemplo n.º 1
0
    def test_garmin_total_summary_report_txt(self):
        """ test GarminReport.total_summary_report_txt """
        gsum = GarminSummary(FITFILE)
        gsum.read_file()
        gr_ = GarminReport()
        output = gr_.total_summary_report_txt(gsum, sport='running')

        mstr = hashlib.md5()
        mstr.update(output.encode())
        self.assertEqual(mstr.hexdigest(), '9f5aa437a6e8bbe6ecd25a088b634018')
Ejemplo n.º 2
0
    def test_garmin_file_report_txt(self):
        """ test GarminReport.file_report_txt """
        gfile = GarminParse(FITFILE)
        gfile.read_file()
        gr_ = GarminReport(gfile=gfile)
        output = gr_.file_report_txt()

        mstr = hashlib.md5()
        mstr.update(output.encode())
        self.assertEqual(mstr.hexdigest(), 'dc49eed73bf44c1b5d5c2444a59bec96')
Ejemplo n.º 3
0
 def test_garmin_week_average_report_txt(self):
     """ test GarminReport.week_average_report_txt """
     gsum = GarminSummary(FITFILE)
     gsum.read_file()
     gr_ = GarminReport()
     output = gr_.week_average_report_txt(gsum,
                                          sport='running',
                                          number_of_weeks=1)
     mstr = hashlib.md5()
     mstr.update(output.encode())
     self.assertEqual(mstr.hexdigest(), '4b649d4c617128138a1540c9dc2e1a09')
Ejemplo n.º 4
0
    def test_garmin_day_summary_report_txt(self):
        """ test GarminReport.day_summary_report_txt """
        gsum = GarminSummary(FITFILE)
        gsum.read_file()
        gr_ = GarminReport()
        output = gr_.day_summary_report_txt(
            gsum, sport='running', cur_date=gsum.begin_datetime.date())

        mstr = hashlib.md5()
        mstr.update(output.encode())
        self.assertEqual(mstr.hexdigest(), 'b05ddcddc03a64b650a75ad397037d00')
Ejemplo n.º 5
0
    def test_garmin_day_average_report_txt(self):
        """ test GarminReport.day_average_report_txt """
        gsum = GarminSummary(FITFILE)
        gsum.read_file()
        gr_ = GarminReport()
        self.assertFalse(gr_.day_average_report_txt(gsum, number_days=0))
        output = gr_.day_average_report_txt(gsum,
                                            sport='running',
                                            number_days=1)

        mstr = hashlib.md5()
        mstr.update(output.encode())
        self.assertEqual(mstr.hexdigest(), '59c50d1eff34a78619e9f37e45445535')
Ejemplo n.º 6
0
    def test_garmin_week_summary_report_txt(self):
        """ test GarminReport.week_summary_report_txt """
        gsum = GarminSummary(FITFILE)
        gsum.read_file()
        gr_ = GarminReport()
        ic_ = gsum.begin_datetime.isocalendar()
        output = gr_.week_summary_report_txt(gsum,
                                             sport='running',
                                             isoyear=ic_[0],
                                             isoweek=ic_[1],
                                             number_in_week=1,
                                             date=gsum.begin_datetime)

        mstr = hashlib.md5()
        mstr.update(output.encode())
        self.assertEqual(mstr.hexdigest(), 'e538e1b1abd954083c9cc19e14d04315')
Ejemplo n.º 7
0
 def test_garmin_file_report_html(self):
     """ test GarminReport.file_report_html """
     gfile = GarminParse(FITFILE)
     gfile.read_file()
     gr_ = GarminReport(gfile=gfile)
     script_path = CURDIR
     options = {
         'script_path': '%s/garmin_app' % script_path,
         'cache_dir': script_path
     }
     html_path = gr_.file_report_html(copy_to_public_html=False,
                                      options=options)
     file_md5 = [[
         'index.html',
         [
             '1c1abe181f36a85949974a222cc874df',
             '548581a142811d412dbf955d2e5372aa',
             '73bb500bed38ef9f2881f11019b7c27c'
         ]
     ]]
     for fn_, fmd5 in file_md5:
         md5 = get_md5('%s/%s' % (html_path, fn_))
         if hasattr(md5, 'decode'):
             md5 = md5.decode()