Пример #1
0
def test_question_import_with_answer_keys(markio_source):
    markio_source += ('\n'
                      'Answer key (python)\n'
                      '-------------------\n'
                      '\n'
                      '    print("hello", input("me "))\n'
                      '\n')
    coding_io_question, keys = CodingIoQuestion.load_markio(markio_source,
                                                            commit=False,
                                                            return_keys=True)
    assert keys.keys() == {'python'}
    assert keys['python'].source == 'print("hello", input("me "))'
Пример #2
0
def test_question_import_with_empty_answer_keys(markio_source):
    coding_io_question, keys = CodingIoQuestion.load_markio(markio_source,
                                                            commit=False,
                                                            return_keys=True)
    assert keys == {}
Пример #3
0
def test_question_import(coding_io_question, full_markio_source):
    imp_question = CodingIoQuestion.load_markio(full_markio_source)

    for attr in ['title', 'short_description', 'long_description', 'timeout']:
        assert getattr(coding_io_question, attr) == getattr(imp_question, attr)