Changed the cython API to create new views so as to have different
functions for the different cases
This commit is contained in:
@ -8,7 +8,7 @@ import string
|
||||
import random
|
||||
|
||||
|
||||
VIEW_TYPES = [None, "NUC_SEQS_VIEW"]
|
||||
VIEW_TYPES = ["", "NUC_SEQS_VIEW"]
|
||||
COL_TYPES = ["OBI_BOOL", "OBI_CHAR", "OBI_FLOAT", "OBI_INT", "OBI_SEQ", "OBI_STR"]
|
||||
NUC_SEQUENCE_COLUMN = "NUC_SEQ"
|
||||
ID_COLUMN = "ID"
|
||||
@ -212,13 +212,12 @@ def fill_view(config, infos):
|
||||
def random_new_view(config, infos, first=False):
|
||||
v_to_clone = None
|
||||
line_selection = None
|
||||
clone = False
|
||||
quality_col = False # TODO
|
||||
if not first:
|
||||
infos['view_names'].append(infos['view'].name)
|
||||
infos['view'].close()
|
||||
v_to_clone = infos['dms'].open_view(random.choice(infos["view_names"]))
|
||||
v_type = None
|
||||
v_type = ""
|
||||
print_test(config, "View to clone: ")
|
||||
print_test(config, repr(v_to_clone))
|
||||
create_line_selection = random_bool(config)
|
||||
@ -230,12 +229,14 @@ def random_new_view(config, infos, first=False):
|
||||
#print_test(config, "New line selection: "+str(line_selection))
|
||||
else :
|
||||
v_type = random_view_type()
|
||||
infos['view'] = infos['dms'].new_view(random_unique_name(infos),
|
||||
view_to_clone=v_to_clone,
|
||||
line_selection=line_selection,
|
||||
view_type=v_type,
|
||||
comments=random_str_with_max_len(config['test']['commentsmaxlen']),
|
||||
quality_column=quality_col)
|
||||
|
||||
if line_selection is not None :
|
||||
infos['view'] = infos['dms'].clone_view_with_line_selection(random_unique_name(infos), line_selection, comments=random_str_with_max_len(config['test']['commentsmaxlen']))
|
||||
elif v_to_clone is not None :
|
||||
infos['view'] = infos['dms'].clone_view(random_unique_name(infos), v_to_clone, comments=random_str_with_max_len(config['test']['commentsmaxlen']))
|
||||
else :
|
||||
infos['view'] = infos['dms'].new_view(random_unique_name(infos), view_type=v_type, comments=random_str_with_max_len(config['test']['commentsmaxlen']), quality_column=quality_col)
|
||||
|
||||
print_test(config, repr(infos['view']))
|
||||
if v_to_clone is not None :
|
||||
if line_selection is None:
|
||||
|
Reference in New Issue
Block a user