ogn-python/tests/commands/test_database.py

22 wiersze
484 B
Python
Czysty Zwykły widok Historia

2019-01-03 18:17:59 +00:00
import unittest
import os
from tests.base import TestBaseDB
from ogn_python.model import DeviceInfo
from ogn_python.commands.database import import_file
2019-01-03 18:17:59 +00:00
class TestDatabase(TestBaseDB):
2019-01-03 18:17:59 +00:00
def test_import_ddb_file(self):
session = self.session
import_file(path=os.path.dirname(__file__) + '/../custom_ddb.txt')
device_infos = session.query(DeviceInfo).all()
self.assertEqual(len(device_infos), 6)
if __name__ == '__main__':
unittest.main()