def test_missing_days(self): fb = FitbitCache('test_user') (dates, items) = populate_fb_object(fb, day_incr=2) x = fb.find_missing_days() self.assertEqual(len(x), dates - 1) # given n days with a gap, there are n-1 missing
cache = FitbitCache(user_name) if cache.data_exists(): cache.read() else: parser.print_help() print('\n ERROR: user {} does not have any data'.format(user_name)) exit(1) print("-------------- User: {} ----------------------".format(user_name)) print("\nDatabase contains %d entries" % len(cache.daylist())) empty_days = cache.remove_days_without_steps() print("\nRemoving days with zero steps") for x in empty_days: print(" %s" % x) missing_days = cache.find_missing_days() if len(missing_days) > 0: print("\nThese days are missing from the database") for x in missing_days: print(" %s" % x) else: print("\nThere are no missing dates") if options.commit: print("\nWriting out database") cache.write()