import influxframework
from influxframework.deferred_insert import deferred_insert, save_to_db
from influxframework.tests.utils import InfluxFrameworkTestCase


class TestDeferredInsert(InfluxFrameworkTestCase):
	def test_deferred_insert(self):
		route_history = {"route": influxframework.generate_hash(), "user": "Administrator"}
		deferred_insert("Route History", [route_history])

		save_to_db()
		self.assertTrue(influxframework.db.exists("Route History", route_history))
