<commit_before>import pytest


@pytest.fixture
def award():
    return{
        'name': 'ENCODE2',
    }


@pytest.fixture
def award_1(award):
    item = award.copy()
    item.update({
        'schema_version': '1',
        'rfa': "ENCODE2"
    })
    return item


def test_award_upgrade(upgrader, award_1):
    value = upgrader.upgrade('award', award_1, target_version='2')
    assert value['schema_version'] == '2'
    assert value['status'] == 'disabled'


def test_award_upgrade_encode3(upgrader, award_1):
    award_1['rfa'] = 'ENCODE3'
    value = upgrader.upgrade('award', award_1, target_version='2')
    assert value['schema_version'] == '2'
    assert value['status'] == 'current'


def test_award_upgrade_url(upgrader, award_1):
    award_1['url'] = ''
    value = upgrader.upgrade('award', award_1, target_version='2')
    assert value['schema_version'] == '2'
    assert 'url' not in value


@pytest.fixture
def award_2(award):
    item = award.copy()
    item.update({
        'schema_version': '3',
        'viewing_group': 'ENCODE',
    })
    return item


def test_award_upgrade_viewing_group(upgrader, award_2):
    value = upgrader.upgrade('award', award_2, target_version='3')
    assert value['schema_version'] == '3'<commit_msg>Fix test<commit_after>import pytest


@pytest.fixture
def award():
    return{
        'name': 'ENCODE2',
    }


@pytest.fixture
def award_1(award):
    item = award.copy()
    item.update({
        'schema_version': '1',
        'rfa': "ENCODE2"
    })
    return item


def test_award_upgrade(upgrader, award_1):
    value = upgrader.upgrade('award', award_1, target_version='2')
    assert value['schema_version'] == '2'
    assert value['status'] == 'disabled'


def test_award_upgrade_encode3(upgrader, award_1):
    award_1['rfa'] = 'ENCODE3'
    value = upgrader.upgrade('award', award_1, target_version='2')
    assert value['schema_version'] == '2'
    assert value['status'] == 'current'


def test_award_upgrade_url(upgrader, award_1):
    award_1['url'] = ''
    value = upgrader.upgrade('award', award_1, target_version='2')
    assert value['schema_version'] == '2'
    assert 'url' not in value


@pytest.fixture
def award_2(award_1):
    item = award_1.copy()
    item.update({
        'schema_version': '3',
        'viewing_group': 'ENCODE',
    })
    return item


def test_award_upgrade_viewing_group(upgrader, award_2):
    value = upgrader.upgrade('award', award_2, target_version='3')
    assert value['schema_version'] == '3'
{'fraction_non_alphanumeric': 0.15261685976827807, 'fraction_numerical': 0.021574111066719935, 'mean_word_length': 3.796934865900383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6425328', 'n_tokens_mistral': 918, 'n_tokens_neox': 895, 'n_words': 172}