'Test the "devstack" task.'

@ddt.data([{}], [{'settings': 'aws'}], [{'asset-settings': 'test_static_optimized'}], [{'settings': 'devstack_optimized', 'asset-settings': 'test_static_optimized'}], [{'fast': True}], [{'optimized': True}], [{'optimized': True, 'fast': True}], [{'no-contracts': True}])
@ddt.unpack
def test_devstack(self, server_options):

    options = server_options.copy()
    is_optimized = options.get('optimized', False)
    expected_settings = ('devstack_optimized' if is_optimized else options.get('settings', Env.DEVSTACK_SETTINGS))
    options['system'] = 'lms'
    options['expected_messages'] = [EXPECTED_INDEX_COURSE_COMMAND.format(system='cms', settings=expected_settings)]
    self.verify_server_task('devstack', options, contracts_default=True)
    options['system'] = 'cms'
    options['expected_messages'] = [EXPECTED_INDEX_COURSE_COMMAND.format(system='cms', settings=expected_settings)]
    self.verify_server_task('devstack', options, contracts_default=True)
