Files
edx-platform/xmodule/capa/tests/test_xqueue_interface.py
Soban Javed 9eba9f983a refactor!: move common/lib/capa/capa to xmodule/capa
As part of dissolving our sub-projects in edx-platform, we are moving this package under the xmodule directory.
We have fixed all the occurences of import of this package and also fixed all documents related references.
This might break your platform if you have any reference of `import capa` or `from capa import` in your codebase or in any Xblock.

Ref: https://openedx.atlassian.net/browse/BOM-2582
2022-07-19 12:20:04 +05:00

42 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
"""
Tests the xqueue service interface.
"""
from unittest import TestCase
from django.conf import settings
from xmodule.capa.xqueue_interface import XQueueInterface, XQueueService
class XQueueServiceTest(TestCase):
"""
Tests the XQueue service methods.
"""
@staticmethod
def construct_callback(*args, **kwargs):
return 'https://lms.url/callback'
def setUp(self):
super().setUp()
self.service = XQueueService(
url=settings.XQUEUE_INTERFACE['url'],
django_auth=settings.XQUEUE_INTERFACE['django_auth'],
basic_auth=settings.XQUEUE_INTERFACE['basic_auth'],
construct_callback=self.construct_callback,
default_queuename='my-very-own-queue',
waittime=settings.XQUEUE_WAITTIME_BETWEEN_REQUESTS,
)
def test_interface(self):
assert isinstance(self.service.interface, XQueueInterface)
def test_construct_callback(self):
assert self.service.construct_callback() == 'https://lms.url/callback'
def test_default_queuename(self):
assert self.service.default_queuename == 'my-very-own-queue'
def test_waittime(self):
assert self.service.waittime == 5