Skip to content

Commit

Permalink
fixed config test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nazmul-me committed Nov 27, 2024
1 parent ee7c9d5 commit 00cffca
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import unittest
import os
from app.config import Config

class TestConfig(unittest.TestCase):
def setUp(self):
"""Set up test environment."""
self.config = Config()

def test_get_database_uri(self):
"""Test get_database_uri method."""

basedir = os.path.abspath(os.path.dirname(__file__))[:-5]
basedir += 'app'
print(basedir)
expected_default_uri = 'sqlite:///' + os.path.join(basedir, 'app.db')
self.assertEqual(self.config.get_database_uri(), expected_default_uri)

def test_is_sqlalchemy_tracking_enabled(self):
"""Test is_sqlalchemy_tracking_enabled method."""
self.assertFalse(self.config.is_sqlalchemy_tracking_enabled())

if __name__ == '__main__':
unittest.main()

0 comments on commit 00cffca

Please sign in to comment.