示例#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
 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
 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
 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')