Ejemplo n.º 1
0
def test_circular_order_random(fixture_xls_copy):
    """This is hoping to find a way to reproduce #126"""
    excel_compiler = ExcelCompiler(fixture_xls_copy('circular.xlsx'),
                                   cycles=True)
    to_verify = list(excel_compiler.formula_cells())

    randgen = random.Random(1234)

    for i in range(100):
        addrs = copy.copy(to_verify)
        randgen.shuffle(addrs)
        excel_compiler = ExcelCompiler(fixture_xls_copy('circular.xlsx'),
                                       cycles=True)
        failed_cells = excel_compiler.validate_serialized(
            tolerance=excel_compiler.cycles['tolerance'],
            output_addrs=addrs,
        )
        assert (failed_cells, addrs) == ({}, addrs)