def test_make_check(question_dir): """Make a check out of the first available question.""" load_questions(question_dir=question_dir) q = list_questions()[0]['name'] qdict = getattr(bfq, q)().make_check().dict() assert qdict.get('assertion') == Assertion(AssertionType.COUNT_EQUALS, 0).dict()
def test_list_questions(tmpdir, session): dir = tmpdir.mkdir("questions") dir.join(TEST_QUESTION_NAME + ".json").write( json.dumps(TEST_QUESTION_DICT)) load_questions(question_dir=dir.strpath, session=session) names = [q["name"] for q in list_questions()] assert names == [TEST_QUESTION_NAME]
def test_list_questions(): current_path = os.path.abspath(os.path.dirname(__file__)) question_directory = os.path.join(current_path, "../../questions") load_questions(question_dir=question_directory) assert list_questions() != []
def test_list_questions(question_dir): load_questions(question_dir=question_dir) assert list_questions() != []