コード例 #1
0
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()
コード例 #2
0
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]
コード例 #3
0
ファイル: test_question.py プロジェクト: cgmcintyr/pybatfish
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() != []
コード例 #4
0
def test_list_questions(question_dir):
    load_questions(question_dir=question_dir)
    assert list_questions() != []