<commit_before>import json
import pytest
from ehb_datasources.drivers.redcap.formBuilderJson import FormBuilderJson


@pytest.fixture()
def form_builder():
    return FormBuilderJson()


def test_construct_form(form_builder, redcap_metadata_json, redcap_record_json):
    form = form_builder.construct_form(
        json.loads(redcap_metadata_json.decode('utf-8')),
        json.loads(redcap_record_json.decode('utf-8')),
        'baseline_visit_data',
        1,
    )
    assert '0GUQDBCDE0EAWN9Q:8LAG76CHO' not in form
    assert '<div><input class="field_input" type="checkbox"  name="meds___1" value="1" style="margin-top:-1px" checked="checked"/> Antibiotic</div>' in form
    assert '<input type="text" value="100" name="height" class="field_input" id="input_height"  />' in form
    assert '<input type="text" value="20" name="weight" class="field_input" id="input_weight"  />' in form
    assert '<textarea rows="5" cols="20" name="comments" class="field_input" >Test Data2</textarea>' in form
    
def test_construct_form2_branch_logic_functions(form_builder, redcap_metadata_json2, redcap_record_json2):
    form = form_builder.construct_form(
        json.loads(redcap_metadata_json2.decode('utf-8')),<commit_msg>additional fix for issue #34<commit_after>import json
import pytest
from ehb_datasources.drivers.redcap.formBuilderJson import FormBuilderJson


@pytest.fixture()
def form_builder():
    return FormBuilderJson()


def test_construct_form(form_builder, redcap_metadata_json, redcap_record_json):
    form = form_builder.construct_form(
        json.loads(redcap_metadata_json.decode('utf-8')),
        json.loads(redcap_record_json.decode('utf-8')),
        'baseline_visit_data',
        1,
    )
    assert '0GUQDBCDE0EAWN9Q:8LAG76CHO' not in form
    assert '<div><input class="field_input" type="checkbox"  name="meds___1" value="1" style="margin-top:-1px" checked="checked"/> Antibiotic</div>' in form
    assert '<input style="min-width: 100px;" type="text" value="100" name="height" class="field_input" id="input_height"  />' in form
    assert 'input style="min-width: 100px;" type="text" value="20" name="weight" class="field_input" id="input_weight"  />' in form
    assert '<textarea rows="5" cols="20" name="comments" class="field_input" >Test Data2</textarea>' in form
    
def test_construct_form2_branch_logic_functions(form_builder, redcap_metadata_json2, redcap_record_json2):
    form = form_builder.construct_form(
        json.loads(redcap_metadata_json2.decode('utf-8')),
{'fraction_non_alphanumeric': 0.13116057233704292, 'fraction_numerical': 0.02384737678855326, 'mean_word_length': 5.503875968992248, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222163', 'n_tokens_mistral': 860, 'n_tokens_neox': 829, 'n_words': 155}