def setUpClass(cls): db_params = ConfigManager.get_db_params() cls.plugin_manager = PluginManager( ConfigManager.get_or_create_plugins_dir(), db_params) cls.garmin_mon_db = MonitoringDb(db_params) table_dict = { 'monitoring_info_table': MonitoringInfo, 'monitoring_hr_table': MonitoringHeartRate, 'monitoring_intensity_table': MonitoringIntensity, 'monitoring_climb_table': MonitoringClimb, 'monitoring_table': Monitoring, } super().setUpClass(cls.garmin_mon_db, table_dict)
def setUpClass(cls): cls.garmin_act_db = ActivitiesDb(ConfigManager.get_db_params()) table_dict = { 'activities_table': Activities, 'activity_laps_table': ActivityLaps, 'activity_records_table': ActivityRecords, 'run_activities_table': StepsActivities, 'paddle_activities_table': PaddleActivities, 'cycle_activities_table': CycleActivities, } super().setUpClass(cls.garmin_act_db, table_dict, {Activities: [Activities.activity_id]}) cls.test_db_params = ConfigManager.get_db_params(test_db=True) cls.plugin_manager = PluginManager( ConfigManager.get_or_create_plugins_dir(), cls.test_db_params) cls.test_mon_db = GarminDb(cls.test_db_params) cls.test_act_db = ActivitiesDb(cls.test_db_params, debug_level=1) cls.measurement_system = fitfile.field_enums.DisplayMeasure.statute print(f"db params {repr(cls.test_db_params)}")
from garmindb import GarminJsonSummaryData, GarminJsonDetailsData, GarminTcxData, GarminActivitiesFitData from garmindb import ActivityExporter from garmindb import ConfigManager, GarminConnectConfigManager, PluginManager from garmindb import Statistics from garmindb import OpenWithBaseCamp, OpenWithGoogleEarth logging.basicConfig(filename='garmindb.log', filemode='w', level=logging.INFO) logger = logging.getLogger(__file__) logger.addHandler(logging.StreamHandler(stream=sys.stdout)) root_logger = logging.getLogger() gc_config = GarminConnectConfigManager() db_params_dict = ConfigManager.get_db_params() plugin_manager = PluginManager(ConfigManager.get_or_create_plugins_dir(), db_params_dict) stats_to_db_map = { Statistics.monitoring : MonitoringDb, Statistics.steps : MonitoringDb, Statistics.itime : MonitoringDb, Statistics.sleep : GarminDb, Statistics.rhr : GarminDb, Statistics.weight : GarminDb, Statistics.activities : ActivitiesDb } summary_dbs = [GarminSummaryDb, SummaryDb]