Esempio n. 1
0
def test_importerror():
    try:
        a = ngvoc.get_vocabulary(voc_type='thereisnosuchclass')
    except ImportError as e:
        if len(e.args) and len(
                e.args[0]) > 14 and e.args[0][:15] == 'No such class: ':
            pass
        else:
            raise
Esempio n. 2
0
def tempvoc4(request):
	param = request.param
	v = ngvoc.get_vocabulary(voc_type=param)
	meanings = ['a','b','c','d','e','f']
	words = list(range(-4,10))
	v.discover_meanings(meanings)
	v.discover_words(words)
	assoc_list = [ (random.choice(meanings),random.choice(words)) for i in range(25)]
	for assoc in assoc_list:
		v.add(m=assoc[0],w=assoc[1],val=round(random.random(),3))
	v.assoc_list = assoc_list
	return v
Esempio n. 3
0
def tempvoc3(request):
    param = request.param
    v = ngvoc.get_vocabulary(voc_type=param)
    meanings = ['a', 'b', 'c', 'd', 'e', 'f']
    words = range(-4, 10)
    v.discover_meanings(meanings)
    v.discover_words(words)
    assoc_list = [(random.choice(meanings), random.choice(words))
                  for i in range(25)]
    for assoc in assoc_list:
        v.add(m=assoc[0], w=assoc[1])
    v.assoc_list = assoc_list
    return v
Esempio n. 4
0
def tempvoc2(request):
    param = request.param
    v = ngvoc.get_vocabulary(voc_type=param)
    meanings = ['a', 'b', 'c', 'd', 'e', 'f']
    words = range(-4, 10)
    v.discover_meanings(meanings)
    v.discover_words(words)
    assoc_list = [
        ('a', 0),
        ('b', 0),
        ('a', 1),
        ('e', 9),
        ('c', 1),
        ('d', 1),
    ]
    for assoc in assoc_list:
        v.add(m=assoc[0], w=assoc[1])
    v.assoc_list = assoc_list
    return v
Esempio n. 5
0
def tempvoc2(request):
	param = request.param
	v = ngvoc.get_vocabulary(voc_type=param)
	meanings = ['a','b','c','d','e','f']
	# words = holedrange.HoledRange(14)
	words = list(range(-4,10))
	v.discover_meanings(meanings)
	v.discover_words(words)
	assoc_list = [
			('a',0),
			('b',0),
			('a',1),
			('e',9),
			('c',1),
			('d',1),
			]
	for assoc in assoc_list:
		v.add(m=assoc[0],w=assoc[1])
	v.assoc_list = assoc_list
	return v
Esempio n. 6
0
def tempvoc(request):
    param = request.param
    return ngvoc.get_vocabulary(voc_type=param)
Esempio n. 7
0
def test_import(voc_type):
    v = ngvoc.get_vocabulary(voc_type=voc_type)
Esempio n. 8
0
def tempvoc(request):
	param = request.param
	return ngvoc.get_vocabulary(voc_type=param)
Esempio n. 9
0
def test_importerror():
	try:
		a = ngvoc.get_vocabulary(voc_type='thereisnosuchclass')
	except ImportError as e:
		assert len(e.args) and len(e.args[0])>14 and e.args[0][:15] == 'No such class: '
Esempio n. 10
0
def test_import(voc_type):
	v = ngvoc.get_vocabulary(voc_type=voc_type)