test_upgrade.py 575 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. """Tests for ``celery upgrade`` command."""
  3. from __future__ import absolute_import, unicode_literals
  4. import pytest
  5. from celery.bin.celery import upgrade
  6. from celery.five import WhateverIO
  7. class test_upgrade:
  8. """Test upgrade command class."""
  9. def test_run(self):
  10. out = WhateverIO()
  11. a = upgrade(app=self.app, stdout=out)
  12. with pytest.raises(a.UsageError, match=r'missing upgrade type'):
  13. a.run()
  14. with pytest.raises(a.UsageError, match=r'missing settings filename'):
  15. a.run('settings')