Exemplo n.º 1
0
 def test_db_callback(self):
     old_dummy_value = dummy_value
     get_new_test_db()
     Database.set_db_callback(callback_test)
     assert old_dummy_value == dummy_value
     Database.record_position(None, "xx", 11, latitude, longitude - 0.05, None, date0, 40, None, False)
     assert old_dummy_value != dummy_value
Exemplo n.º 2
0
                                    size="xl",
                                )
                            ]),
                    dbc.Tab(label="Map", tab_id="map", children=[maps]),
                    dbc.Tab(label="Control",
                            tab_id="control",
                            children=dbc.Tabs(id="control-tabs",
                                              children=__get_control_tabs()))
                ],
                         id="tabs",
                         active_tab="summary",
                         persistence=True),
                html.Div(id=EMPTY_DIV),
                html.Div(id=EMPTY_DIV + "1")
            ])
        ])
        cached_layout = dbc.Container(
            fluid=True, children=[html.H1('My car info'), data_div])
    return cached_layout


try:
    Charging.set_default_price()
    Database.set_db_callback(update_trips)
    update_trips()
except (IndexError, TypeError):
    logger.debug("Failed to get trips, there is probably not enough data yet:",
                 exc_info=True)

dash_app.layout = serve_layout