From 95efe1ba028b137ebaa8e187435dcc209ff01818 Mon Sep 17 00:00:00 2001 From: Gunther Cox Date: Thu, 20 Jul 2017 07:06:54 -0400 Subject: [PATCH] Add tests for database name and uri --- .../storage_adapter_tests/test_sqlalchemy_adapter.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/storage_adapter_tests/test_sqlalchemy_adapter.py b/tests/storage_adapter_tests/test_sqlalchemy_adapter.py index 15497f981..826da95b7 100644 --- a/tests/storage_adapter_tests/test_sqlalchemy_adapter.py +++ b/tests/storage_adapter_tests/test_sqlalchemy_adapter.py @@ -27,6 +27,18 @@ def tearDown(self): class SQLStorageAdapterTestCase(SQLAlchemyAdapterTestCase): + def test_set_database_name_none(self): + adapter = SQLStorageAdapter(database=None) + self.assertEqual(adapter.database_uri, 'sqlite://') + + def test_set_database_name(self): + adapter = SQLStorageAdapter(database='test') + self.assertEqual(adapter.database_uri, 'sqlite:///test.db') + + def test_set_database_uri(self): + adapter = SQLStorageAdapter(database_uri='sqlite:///db.sqlite3') + self.assertEqual(adapter.database_uri, 'sqlite:///db.sqlite3') + def test_count_returns_zero(self): """ The count method should return a value of 0