コード例 #1
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'
         )
コード例 #2
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')
コード例 #3
0
ファイル: django.py プロジェクト: DarkSinclair/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')
コード例 #4
0
ファイル: django.py プロジェクト: DarkSinclair/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')
コード例 #5
0
ファイル: django.py プロジェクト: DarkSinclair/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')
コード例 #6
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')