Fix all tests.

main
Vincent Driessen 10 years ago
parent c860beb4d5
commit dab8373311

@ -18,7 +18,7 @@ else:
from unittest2 import TestCase # noqa from unittest2 import TestCase # noqa
class TestScripts(TestCase): class TestCommandLine(TestCase):
def test_config_file(self): def test_config_file(self):
settings = read_config_file("tests.dummy_settings") settings = read_config_file("tests.dummy_settings")
self.assertIn("REDIS_HOST", settings) self.assertIn("REDIS_HOST", settings)
@ -40,21 +40,20 @@ class TestRQCli(RQTestCase):
def test_empty(self): def test_empty(self):
"""rq -u <url> empty -y""" """rq -u <url> empty -y"""
runner = CliRunner() runner = CliRunner()
result = runner.invoke(main, ['-u', self.redis_url, 'empty', "-y"]) result = runner.invoke(main, ['empty', '-u', self.redis_url, 'failed'])
self.assertEqual(result.exit_code, 0) self.assertEqual(result.exit_code, 0)
self.assertEqual(result.output, '1 jobs removed from failed queue\n') self.assertEqual(result.output.strip(), '1 jobs removed from failed queue')
def test_requeue(self): def test_requeue(self):
"""rq -u <url> requeue""" """rq -u <url> requeue"""
runner = CliRunner() runner = CliRunner()
result = runner.invoke(main, ['-u', self.redis_url, 'requeue', '-a']) result = runner.invoke(main, ['requeue', '-u', self.redis_url, '--all'])
self.assertEqual(result.exit_code, 0) self.assertEqual(result.exit_code, 0)
self.assertIn('Requeueing 1 jobs from FailedQueue', result.output) self.assertEqual(result.output.strip(), 'Requeueing 1 jobs from failed queue')
self.assertIn('Unable to requeue 0 jobs from FailedQueue', result.output)
def test_info(self): def test_info(self):
"""rq -u <url> info -i 0""" """rq -u <url> info -i 0"""
runner = CliRunner() runner = CliRunner()
result = runner.invoke(main, ['-u', self.redis_url, 'info', '-i 0']) result = runner.invoke(main, ['info', '-u', self.redis_url])
self.assertEqual(result.exit_code, 0) self.assertEqual(result.exit_code, 0)
self.assertIn('1 queues, 1 jobs total', result.output) self.assertIn('1 queues, 1 jobs total', result.output)
Loading…
Cancel
Save