Skip to content

Commit

Permalink
Trying to change hardcoded urls away from localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
paxnovem committed May 21, 2024
1 parent 65155a1 commit 045e9b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_flaskrq.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class config:
RQ_LOW_DB = 1
RQ_HIGH_URL = 'redis://redis:6379/3'
RQ_HIGH_URL = 'redis://localhost:6379/3'


def create_app():
Expand All @@ -27,21 +27,21 @@ def test_config_default_value_port(self):
self.assertEqual(config_value('default', 'PORT'), 6379)

def test_config_low_value_from_default(self):
self.assertEqual(config_value('low', 'HOST'), 'localhost')
self.assertEqual(config_value('low', 'HOST'), 'redis')

def test_config_low_specific_value(self):
self.assertEqual(config_value('low', 'DB'), 1)

def test_get_connection_default(self):
connection = get_connection()
connection_kwargs = connection.connection_pool.connection_kwargs
self.assertEqual(connection_kwargs.get('host'), 'localhost')
self.assertEqual(connection_kwargs.get('host'), 'redis')
self.assertEqual(connection_kwargs.get('port'), 6379)

def test_connection_from_url(self):
connection = get_connection('high')
connection_kwargs = connection.connection_pool.connection_kwargs
self.assertEqual(connection_kwargs.get('host'), 'localhost')
self.assertEqual(connection_kwargs.get('host'), 'redis')
self.assertEqual(connection_kwargs.get('port'), 6379)
self.assertEqual(connection_kwargs.get('db'), 3)

Expand All @@ -59,10 +59,10 @@ def test_job_specified_queue(self):
get_worker('low').work(True)

def test_get_server_url_default(self):
self.assertEqual(get_server_url('high'), 'redis://localhost:6379')
self.assertEqual(get_server_url('high'), 'redis://redis:6379')

def test_get_server_url_from_dsn(self):
self.assertEqual(get_server_url('high'), 'redis://localhost:6379')
self.assertEqual(get_server_url('high'), 'redis://redis:6379')

def test_get_worker_default(self):
worker = get_worker()
Expand Down

0 comments on commit 045e9b7

Please sign in to comment.