def get_validity(sexpected, sresult, soutfile, force_id_mask=False):
    if not os.path.exists(sexpected):  # create expected file
        with open(sexpected, 'w') as f:
            f.write(normalize(sresult, force_id_mask))
        sstatus = 0
    else:  # compare result with expected
        if not os.path.exists('results'):
            os.mkdir('results')
        with open('results%s%s' % (os.sep, soutfile), 'wb') as f:
            f.write(normalize(sresult, force_id_mask))
        if filecmp.cmp(sexpected, 'results%s%s' % (os.sep, soutfile)):  # pass
            os.remove('results%s%s' % (os.sep, soutfile))
            sstatus = 1
        else:  # fail
            import difflib
            with codecs.open(sexpected, encoding=ENCODING) as a:
                with codecs.open('results%s%s' % (os.sep, soutfile),
                                 encoding=ENCODING) as b:
                    a2 = a.readlines()
                    b2 = b.readlines()
                    diff = difflib.unified_diff(a2, b2)
            print('\n'.join(list(diff)))
            if len(a2) != len(b2):
                print('LINE COUNT: expected: %d, result: %d' % (len(a2), len(b2)))
            sstatus = -1
    return sstatus
Returns a tranlated output card, given the solver name and inputcard.
dataset/ETHPy150Open geopython/pycsw/tests/run_tests.py/get_validity--crossover with--dataset/ETHPy150Open saullocastro/mapy/mapy/reader/cardtranslator.py/card2dict