Skip to content

Commit

Permalink
[test] fix tests/utils/test_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Jan 8, 2025
1 parent e519821 commit 0d4194e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from zou.app.utils import colors, fields, query, fs, shell, date_helpers, redis
from zou.app.models.person import Person
from zou.app.models.task import Task
from zou.app import config


class UtilsTestCase(unittest.TestCase):
Expand Down Expand Up @@ -118,16 +119,13 @@ def test_date(self):
self.assertEqual(end.strftime("%Y-%m-%d"), "2021-02-11")

def test_get_redis_url(self):
redis_host = "localhost"
redis_port = 6379
db_index = 0
redis_password = ""
self.assertEqual(
redis.get_redis_url(),
f"redis://{redis_host}:{redis_port}/{db_index}",
redis.get_redis_url(db_index),
f"redis://{config.KEY_VALUE_STORE["host"]}:{config.KEY_VALUE_STORE["port"]}/{db_index}",
)
redis_password = "password"
config.KEY_VALUE_STORE["password"] = "password"
self.assertEqual(
redis.get_redis_url(),
f"redis://:{redis_password}@{redis_host}:{redis_port}/{db_index}",
redis.get_redis_url(db_index),
f"redis://:{config.KEY_VALUE_STORE["password"]}@{config.KEY_VALUE_STORE["host"]}:{config.KEY_VALUE_STORE["port"]}/{db_index}",
)

0 comments on commit 0d4194e

Please sign in to comment.