test_sqlite.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #============================================================================
  2. # This file is part of Pwman3.
  3. #
  4. # Pwman3 is free software; you can redistribute iut and/or modify
  5. # it under the terms of the GNU General Public License, version 2
  6. # as published by the Free Software Foundation;
  7. #
  8. # Pwman3 is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with Pwman3; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. #============================================================================
  17. # Copyright (C) 2012 Oz Nahum Tiram <nahumoz@gmail.com>
  18. #============================================================================
  19. import os
  20. import unittest
  21. from pwman.data.drivers.sqlite import SQLite
  22. class TestConfig(unittest.TestCase):
  23. def setUp(self):
  24. self.db = SQLite('test.db')
  25. def test_create_tables(self):
  26. # the method _open calls _create_tables
  27. self.db._open()
  28. if __name__ == '__main__':
  29. try:
  30. unittest.main(verbosity=2)
  31. except SystemExit:
  32. os.remove('test.db')