<commit_before>from nose.tools import assert_dict_equal
from . import schema


def test_view():
    view = schema.Glot()
    assert_dict_equal(dict(view.fetch()), dict(view.definition.fetch()))
    <commit_msg>added more tests for dj.View<commit_after>from nose.tools import assert_dict_equal, raises
import datajoint as dj
from . import schema


def test_view():
    view = schema.Glot()
    assert_dict_equal(dict(view.fetch()), dict(view.definition.fetch()))


@raises(dj.DataJointError)
def missing_definition():
    class BadView(dj.View):
        misspelled = schema.Glot()
    BadView()


@raises(dj.DataJointError)
def missing_definition():
    class BadView(dj.View):
        definition = """
        id : int
        ---
        value : double
        """
    BadView()
{'fraction_non_alphanumeric': 0.12323491655969192, 'fraction_numerical': 0.0, 'mean_word_length': 3.3820224719101124, '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': '7086535', 'n_tokens_mistral': 249, 'n_tokens_neox': 238, 'n_words': 54}