예제 #1
0
파일: django.py 프로젝트: Barrybaby/salt
 def test_command_with_args(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {"cmd.run": mock}):
         django.command("settings.py", "runserver", None, None, "noinput", "somethingelse")
         mock.assert_called_once_with(
             "django-admin.py runserver --settings=settings.py " "--noinput --somethingelse"
         )
예제 #2
0
 def test_django_admin_cli_command(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__, {'cmd.run': mock}):
         djangomod.command('settings.py', 'runserver')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py',
             python_shell=False,
             env=None)
예제 #3
0
 def test_command_with_args(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {'cmd.run': mock}):
         django.command('settings.py', 'runserver', None, None, 'noinput',
                        'somethingelse')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py '
             '--noinput --somethingelse')
예제 #4
0
파일: django.py 프로젝트: joehealy/pkg-salt
 def test_command(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.command('settings.py', 'runserver')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py',
             env=None
         )
예제 #5
0
 def test_command(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.command('settings.py', 'runserver')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py',
             env=None
         )
예제 #6
0
 def test_command_with_kwargs_ignore_dunder(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {'cmd.run': mock}):
         django.command('settings.py',
                        'runserver',
                        None,
                        None,
                        __ignore='something')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py')
예제 #7
0
 def test_django_admin_cli_command(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__, {"cmd.run": mock}):
         djangomod.command("settings.py", "runserver")
         mock.assert_called_once_with(
             "django-admin.py runserver --settings=settings.py",
             python_shell=False,
             env=None,
             runas=None,
         )
예제 #8
0
파일: django.py 프로젝트: joehealy/pkg-salt
 def test_command_with_kwargs_ignore_dunder(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.command(
             'settings.py', 'runserver', None, None, __ignore='something'
         )
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py',
             env=None
         )
예제 #9
0
 def test_django_admin_cli_command_with_args(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__, {'cmd.run': mock}):
         djangomod.command('settings.py', 'runserver', None, None, None,
                           None, 'noinput', 'somethingelse')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py '
             '--noinput --somethingelse',
             python_shell=False,
             env=None,
             runas=None)
예제 #10
0
파일: django.py 프로젝트: yeyuexia/salt
 def test_command_with_kwargs(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {'cmd.run': mock}):
         django.command('settings.py',
                        'runserver',
                        None,
                        None,
                        database='something')
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py '
             '--database=something',
             env=None)
예제 #11
0
 def test_django_admin_cli_command_with_kwargs_ignore_dunder(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__,
                     {'cmd.run': mock}):
         djangomod.command(
             'settings.py', 'runserver', None, None, None, __ignore='something'
         )
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py',
             python_shell=False,
             env=None,
             runas=None
         )
예제 #12
0
 def test_command(self):
     """
     Test if it runs arbitrary django management command
     """
     mock = MagicMock(return_value=True)
     with patch.dict(djangomod.__salt__, {"cmd.run": mock}):
         self.assertTrue(djangomod.command("DJANGO_SETTINGS_MODULE", "validate"))
예제 #13
0
파일: django.py 프로젝트: DaveQB/salt
 def test_command_with_kwargs(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.command(
             'settings.py',
             'runserver',
             None,
             None,
             database='something'
         )
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py '
             '--database=something',
             python_shell=False,
             env=None
         )
예제 #14
0
 def test_command(self):
     '''
     Test if it runs arbitrary django management command
     '''
     mock = MagicMock(return_value=True)
     with patch.dict(djangomod.__salt__, {'cmd.run': mock}):
         self.assertTrue(djangomod.command('DJANGO_SETTINGS_MODULE',
                                           'validate'))
예제 #15
0
파일: django.py 프로젝트: joehealy/pkg-salt
 def test_command_with_args(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.command(
             'settings.py',
             'runserver',
             None,
             None,
             None,
             'noinput',
             'somethingelse'
         )
         mock.assert_called_once_with(
             'django-admin.py runserver --settings=settings.py '
             '--noinput --somethingelse',
             env=None
         )
예제 #16
0
파일: django.py 프로젝트: Barrybaby/salt
 def test_command_with_kwargs_ignore_dunder(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {"cmd.run": mock}):
         django.command("settings.py", "runserver", None, None, __ignore="something")
         mock.assert_called_once_with("django-admin.py runserver --settings=settings.py")
예제 #17
0
파일: django.py 프로젝트: Barrybaby/salt
 def test_command(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {"cmd.run": mock}):
         django.command("settings.py", "runserver")
         mock.assert_called_once_with("django-admin.py runserver --settings=settings.py")