Skip to content

Commit

Permalink
Don't append .db to sql database name
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Aug 15, 2017
1 parent d20263a commit 9f4b385
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chatterbot/storage/sql_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, **kwargs):

# Create a sqlite file if a database name is provided
if database_name:
self.database_uri = "sqlite:///" + database_name + ".db"
self.database_uri = "sqlite:///" + database_name

self.engine = create_engine(self.database_uri, convert_unicode=True)

Expand Down
4 changes: 2 additions & 2 deletions tests/storage_adapter_tests/test_sqlalchemy_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_set_database_name_none(self):
self.assertEqual(adapter.database_uri, 'sqlite://')

def test_set_database_name(self):
adapter = SQLStorageAdapter(database='test')
self.assertEqual(adapter.database_uri, 'sqlite:///test.db')
adapter = SQLStorageAdapter(database='test.sqlite3')
self.assertEqual(adapter.database_uri, 'sqlite:///test.sqlite3')

def test_set_database_uri(self):
adapter = SQLStorageAdapter(database_uri='sqlite:///db.sqlite3')
Expand Down

0 comments on commit 9f4b385

Please sign in to comment.