def assert_output(s1, num, s2=None):
    tables = str2tables(s1)
    selected = _get_table_suggestions(tables, num)
    if selected:
        sres = tables2str(tables, selected)
        if s2:
            print s2 == sres
            if s2 != sres:
                print sres
        else:
            print sres
def random_tests():
    random.seed(0)
    for n in range(10):
        print 'Facility',n
        s = random_tables()
        print '['+s+']'
        tables = str2tables(s)
        for n in range(10):
            print 'ite',n
            num = random.randint(1, 5) #[a,b]
            print 'num:',num
            selected = _get_table_suggestions(tables, num)
            if selected is None:
                print "doesn't fit"
                print tables2str(tables, [])
            else:
                print tables2str(tables, selected)