Предизвикателства > Сляпа баба > Решения > Решението на Сашо Василчев

Резултати
0 точки от тестове
2 точки от учител

2 точки общо

0 успешни теста
1 неуспешни теста
Код

  1import types
  2
  3
  4RANDOM_BIG_EVEN_NUMBER = 69420
  5RANDOM_BIG_ODD_NUMBER = 42069
  6RANDOM_STRING_1 = ".!."
  7RANDOM_STRING_2 = "(. )( .)"
  8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."
  9INTERESTING_PATHS_ENDS = "clue"
 10
 11
 12def case_5_test(method):
 13    return isinstance(method, types.FunctionType)
 14
 15
 16def case_4_test(method):
 17    try:
 18        return (
 19            method(right=RANDOM_STRING_1, left=RANDOM_STRING_2)
 20            == RANDOM_STRING_2 + RANDOM_STRING_1
 21            and method(left=RANDOM_STRING_1, right=RANDOM_STRING_2)
 22            == RANDOM_STRING_1 + RANDOM_STRING_2
 23        )  # тези грозни неща са заради auto formater-а който ползвам и ме мързи да го сменя :)
 24    except:
 25        return False
 26
 27
 28def case_3_test(method):
 29    try:
 30        return (
 31            method(RANDOM_BIG_ODD_NUMBER) == 0
 32            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**2
 33        )
 34    except:
 35        return False
 36
 37
 38def case_2_test(method):
 39    try:
 40        method()
 41        return False
 42    except Exception:
 43        return False
 44    except (KeyboardInterrupt, SystemExit):
 45        raise
 46    except BaseException:
 47        return True
 48    except:  # това май е безполезно, но за всеки случай
 49        return False
 50
 51
 52def case_1_test(method):
 53    try:
 54        method()
 55        return False
 56    except TypeError as e:
 57        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE
 58    except:
 59        return False
 60
 61
 62def is_interesting(current, method_name, recursion_depth):
 63    method = getattr(current, method_name)
 64    if len(method_name) > 1 or not callable(method):
 65        return False
 66
 67    if recursion_depth > 0 and case_5_test(method):
 68        return True
 69    return (
 70        case_4_test(method)
 71        or case_3_test(method)
 72        or case_2_test(method)
 73        or case_1_test(method)
 74    )
 75
 76
 77def dfs(current, simbols_dict, recursion_depth):
 78    for next_mod in dir(current):
 79        if is_interesting(current, next_mod, recursion_depth):
 80            simbols_dict[next_mod] = getattr(current, next_mod)
 81        elif INTERESTING_PATHS_ENDS in next_mod:
 82            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)
 83
 84
 85def methodify():
 86    simbols_dict = {}
 87    import secret
 88
 89    dfs(secret, simbols_dict, 0)
 90
 91    return (
 92        simbols_dict["F"],
 93        simbols_dict["N"],
 94        simbols_dict["0"],
 95        simbols_dict["M"],
 96        simbols_dict["I"],
 97        simbols_dict["0"],
 98        simbols_dict["6"],
 99        simbols_dict["0"],
100        simbols_dict["0"],
101        simbols_dict["1"],
102        simbols_dict["9"],
103        simbols_dict["7"],
104    )

F
======================================================================
FAIL: test_metodify (test.TestMethodify)
Test metodify function.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 12, in test_metodify
self.assertIn(methodify(), _RESULTS.keys())
AssertionError: (<function decoy_1 at 0x7f388e113250>, <function decoy_1 at 0x7f388e113250>, <function decoy_3 at 0x7f388e113370>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function decoy_3 at 0x7f388e113370>, <function decoy_3 at 0x7f388e113370>, <function decoy_3 at 0x7f388e113370>, <function decoy_3 at 0x7f388e113370>, <function decoy_4 at 0x7f388e113400>, <function method_9 at 0x7f388e1131c0>, <function method_7 at 0x7f388e1130a0>) not found in dict_keys([(<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_2 at 0x7f388e112dd0>, <function method_3 at 0x7f388e112e60>, <function method_4 at 0x7f388e112ef0>, <function method_5 at 0x7f388e112f80>, <function method_6 at 0x7f388e113010>, <function method_7 at 0x7f388e1130a0>, <function method_8 at 0x7f388e113130>, <function method_9 at 0x7f388e1131c0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_4 at 0x7f388e112ef0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_5 at 0x7f388e112f80>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_9 at 0x7f388e1131c0>, <function method_5 at 0x7f388e112f80>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_5 at 0x7f388e112f80>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_4 at 0x7f388e112ef0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_1 at 0x7f388e112d40>, <function method_5 at 0x7f388e112f80>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_1 at 0x7f388e112d40>, <function method_6 at 0x7f388e113010>, <function method_5 at 0x7f388e112f80>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_4 at 0x7f388e112ef0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_3 at 0x7f388e112e60>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_9 at 0x7f388e1131c0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_4 at 0x7f388e112ef0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_4 at 0x7f388e112ef0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_5 at 0x7f388e112f80>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_1 at 0x7f388e112d40>, <function method_5 at 0x7f388e112f80>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_5 at 0x7f388e112f80>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_4 at 0x7f388e112ef0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_1 at 0x7f388e112d40>, <function method_5 at 0x7f388e112f80>, <function method_9 at 0x7f388e1131c0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_9 at 0x7f388e1131c0>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_3 at 0x7f388e112e60>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_5 at 0x7f388e112f80>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_1 at 0x7f388e112d40>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_9 at 0x7f388e1131c0>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>, <function method_5 at 0x7f388e112f80>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_5 at 0x7f388e112f80>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_3 at 0x7f388e112e60>, <function method_9 at 0x7f388e1131c0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_4 at 0x7f388e112ef0>, <function method_9 at 0x7f388e1131c0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_8 at 0x7f388e113130>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_7 at 0x7f388e1130a0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_1 at 0x7f388e112d40>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_5 at 0x7f388e112f80>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_6 at 0x7f388e113010>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_4 at 0x7f388e112ef0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_1 at 0x7f388e112d40>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_7 at 0x7f388e1130a0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_4 at 0x7f388e112ef0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_1 at 0x7f388e112d40>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_4 at 0x7f388e112ef0>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_0 at 0x7f388e112cb0>, <function method_4 at 0x7f388e112ef0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_3 at 0x7f388e112e60>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_1 at 0x7f388e112d40>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_1 at 0x7f388e112d40>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_4 at 0x7f388e112ef0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_9 at 0x7f388e1131c0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>, <function method_9 at 0x7f388e1131c0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_9 at 0x7f388e1131c0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_1 at 0x7f388e112d40>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_6 at 0x7f388e113010>, <function method_8 at 0x7f388e113130>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_1 at 0x7f388e112d40>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_3 at 0x7f388e112e60>, <function method_4 at 0x7f388e112ef0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_4 at 0x7f388e112ef0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_5 at 0x7f388e112f80>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>, <function method_8 at 0x7f388e113130>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_1 at 0x7f388e112d40>, <function method_5 at 0x7f388e112f80>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_3 at 0x7f388e112e60>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_9 at 0x7f388e1131c0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_4 at 0x7f388e112ef0>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_7 at 0x7f388e1130a0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_5 at 0x7f388e112f80>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_2 at 0x7f388e112dd0>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_9 at 0x7f388e1131c0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_2 at 0x7f388e112dd0>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_2 at 0x7f388e112dd0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_1 at 0x7f388e112d40>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_7 at 0x7f388e1130a0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_5 at 0x7f388e112f80>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_8 at 0x7f388e113130>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_8 at 0x7f388e113130>, <function method_5 at 0x7f388e112f80>, <function method_5 at 0x7f388e112f80>, <function method_3 at 0x7f388e112e60>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_1 at 0x7f388e112d40>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_7 at 0x7f388e1130a0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_9 at 0x7f388e1131c0>, <function method_8 at 0x7f388e113130>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_2 at 0x7f388e112dd0>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_7 at 0x7f388e1130a0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_7 at 0x7f388e1130a0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_9 at 0x7f388e1131c0>, <function method_2 at 0x7f388e112dd0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_0 at 0x7f388e112cb0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_7 at 0x7f388e1130a0>, <function method_1 at 0x7f388e112d40>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_1 at 0x7f388e112d40>, <function method_4 at 0x7f388e112ef0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_0 at 0x7f388e112cb0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_3 at 0x7f388e112e60>, <function method_4 at 0x7f388e112ef0>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>, <function method_5 at 0x7f388e112f80>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_2 at 0x7f388e112dd0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_9 at 0x7f388e1131c0>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_3 at 0x7f388e112e60>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_1 at 0x7f388e112d40>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_1 at 0x7f388e112d40>, <function method_8 at 0x7f388e113130>, <function method_7 at 0x7f388e1130a0>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_5 at 0x7f388e112f80>, <function method_2 at 0x7f388e112dd0>, <function method_6 at 0x7f388e113010>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_7 at 0x7f388e1130a0>, <function method_M at 0x7f388e112b90>, <function method_I at 0x7f388e112c20>, <function method_0 at 0x7f388e112cb0>, <function method_6 at 0x7f388e113010>, <function method_0 at 0x7f388e112cb0>, <function method_0 at 0x7f388e112cb0>, <function method_2 at 0x7f388e112dd0>, <function method_1 at 0x7f388e112d40>, <function method_8 at 0x7f388e113130>), (<function method_F at 0x7f388e112a70>, <function method_N at 0x7f388e112b00>, <function method_6 at 0x7f388e113010>, <function method_2 at 0x7f388e112dd0>, <function method_4 at 0x7f388e112ef0>, <function method_8 at 0x7f388e113130>, <function method_7 at 0x7f388e1130a0>)])

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (failures=1)

Дискусия
История

f1import typesf1import types
22
33
n4RANDOM_BIG_EVEN_NUMBER = 9384934n4RANDOM_BIG_EVEN_NUMBER = 69420
5RANDOM_BIG_ODD_NUMBER = 7832467895RANDOM_BIG_ODD_NUMBER = 42069
6RANDOM_STRING_1 = "@d5efSFRS//!!"6RANDOM_STRING_1 = ".!."
7RANDOM_STRING_2 = "*dsa23w@sefS_RS//!!"7RANDOM_STRING_2 = "(. )( .)"
8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."
9INTERESTING_PATHS_ENDS = "clue"9INTERESTING_PATHS_ENDS = "clue"
1010
1111
12def case_5_test(method):12def case_5_test(method):
13    return isinstance(method, types.FunctionType)13    return isinstance(method, types.FunctionType)
1414
1515
16def case_4_test(method):16def case_4_test(method):
17    try:17    try:
n18        if (n18        return (
19            method(right=RANDOM_STRING_1, left=RANDOM_STRING_2)19            method(right=RANDOM_STRING_1, left=RANDOM_STRING_2)
20            == RANDOM_STRING_2 + RANDOM_STRING_120            == RANDOM_STRING_2 + RANDOM_STRING_1
21            and method(left=RANDOM_STRING_1, right=RANDOM_STRING_2)21            and method(left=RANDOM_STRING_1, right=RANDOM_STRING_2)
22            == RANDOM_STRING_1 + RANDOM_STRING_222            == RANDOM_STRING_1 + RANDOM_STRING_2
n23        ):  # тези if-ове са грозни заради auto formater-а който ползвам и ме мързи да го сменя :)n23        )  # тези грозни неща са заради auto formater-а който ползвам и ме мързи да го сменя :)
24            return True
25    except:24    except:
26        return False25        return False
2726
2827
29def case_3_test(method):28def case_3_test(method):
30    try:29    try:
n31        if (n30        return (
32            method(RANDOM_BIG_ODD_NUMBER) == 031            method(RANDOM_BIG_ODD_NUMBER) == 0
33            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**232            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**2
t34        ):t33        )
35            return True
36    except:34    except:
37        return False35        return False
3836
3937
40def case_2_test(method):38def case_2_test(method):
41    try:39    try:
42        method()40        method()
43        return False41        return False
44    except Exception:42    except Exception:
45        return False43        return False
46    except (KeyboardInterrupt, SystemExit):44    except (KeyboardInterrupt, SystemExit):
47        raise45        raise
48    except BaseException:46    except BaseException:
49        return True47        return True
50    except:  # това май е безполезно, но за всеки случай48    except:  # това май е безполезно, но за всеки случай
51        return False49        return False
5250
5351
54def case_1_test(method):52def case_1_test(method):
55    try:53    try:
56        method()54        method()
57        return False55        return False
58    except TypeError as e:56    except TypeError as e:
59        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE57        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE
60    except:58    except:
61        return False59        return False
6260
6361
64def is_interesting(current, method_name, recursion_depth):62def is_interesting(current, method_name, recursion_depth):
65    method = getattr(current, method_name)63    method = getattr(current, method_name)
66    if len(method_name) > 1 or not callable(method):64    if len(method_name) > 1 or not callable(method):
67        return False65        return False
6866
69    if recursion_depth > 0 and case_5_test(method):67    if recursion_depth > 0 and case_5_test(method):
70        return True68        return True
71    return (69    return (
72        case_4_test(method)70        case_4_test(method)
73        or case_3_test(method)71        or case_3_test(method)
74        or case_2_test(method)72        or case_2_test(method)
75        or case_1_test(method)73        or case_1_test(method)
76    )74    )
7775
7876
79def dfs(current, simbols_dict, recursion_depth):77def dfs(current, simbols_dict, recursion_depth):
80    for next_mod in dir(current):78    for next_mod in dir(current):
81        if is_interesting(current, next_mod, recursion_depth):79        if is_interesting(current, next_mod, recursion_depth):
82            simbols_dict[next_mod] = getattr(current, next_mod)80            simbols_dict[next_mod] = getattr(current, next_mod)
83        elif INTERESTING_PATHS_ENDS in next_mod:81        elif INTERESTING_PATHS_ENDS in next_mod:
84            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)82            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)
8583
8684
87def methodify():85def methodify():
88    simbols_dict = {}86    simbols_dict = {}
89    import secret87    import secret
9088
91    dfs(secret, simbols_dict, 0)89    dfs(secret, simbols_dict, 0)
9290
93    return (91    return (
94        simbols_dict["F"],92        simbols_dict["F"],
95        simbols_dict["N"],93        simbols_dict["N"],
96        simbols_dict["0"],94        simbols_dict["0"],
97        simbols_dict["M"],95        simbols_dict["M"],
98        simbols_dict["I"],96        simbols_dict["I"],
99        simbols_dict["0"],97        simbols_dict["0"],
100        simbols_dict["6"],98        simbols_dict["6"],
101        simbols_dict["0"],99        simbols_dict["0"],
102        simbols_dict["0"],100        simbols_dict["0"],
103        simbols_dict["1"],101        simbols_dict["1"],
104        simbols_dict["9"],102        simbols_dict["9"],
105        simbols_dict["7"],103        simbols_dict["7"],
106    )104    )
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import typesf1import types
22
33
4RANDOM_BIG_EVEN_NUMBER = 93849344RANDOM_BIG_EVEN_NUMBER = 9384934
5RANDOM_BIG_ODD_NUMBER = 7832467895RANDOM_BIG_ODD_NUMBER = 783246789
6RANDOM_STRING_1 = "@d5efSFRS//!!"6RANDOM_STRING_1 = "@d5efSFRS//!!"
7RANDOM_STRING_2 = "*dsa23w@sefS_RS//!!"7RANDOM_STRING_2 = "*dsa23w@sefS_RS//!!"
8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."
9INTERESTING_PATHS_ENDS = "clue"9INTERESTING_PATHS_ENDS = "clue"
1010
1111
12def case_5_test(method):12def case_5_test(method):
13    return isinstance(method, types.FunctionType)13    return isinstance(method, types.FunctionType)
1414
1515
16def case_4_test(method):16def case_4_test(method):
17    try:17    try:
18        if (18        if (
t19            method(RANDOM_STRING_1, RANDOM_STRING_2)t19            method(right=RANDOM_STRING_1, left=RANDOM_STRING_2)
20            == RANDOM_STRING_2 + RANDOM_STRING_1
21            and method(left=RANDOM_STRING_1, right=RANDOM_STRING_2)
20            == RANDOM_STRING_1 + RANDOM_STRING_222            == RANDOM_STRING_1 + RANDOM_STRING_2
21        ):  # тези if-ове са грозни заради auto formater-а който ползвам и ме мързи да го сменя :)23        ):  # тези if-ове са грозни заради auto formater-а който ползвам и ме мързи да го сменя :)
22            return True24            return True
23    except:25    except:
24        return False26        return False
2527
2628
27def case_3_test(method):29def case_3_test(method):
28    try:30    try:
29        if (31        if (
30            method(RANDOM_BIG_ODD_NUMBER) == 032            method(RANDOM_BIG_ODD_NUMBER) == 0
31            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**233            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**2
32        ):34        ):
33            return True35            return True
34    except:36    except:
35        return False37        return False
3638
3739
38def case_2_test(method):40def case_2_test(method):
39    try:41    try:
40        method()42        method()
41        return False43        return False
42    except Exception:44    except Exception:
43        return False45        return False
44    except (KeyboardInterrupt, SystemExit):46    except (KeyboardInterrupt, SystemExit):
45        raise47        raise
46    except BaseException:48    except BaseException:
47        return True49        return True
48    except:  # това май е безполезно, но за всеки случай50    except:  # това май е безполезно, но за всеки случай
49        return False51        return False
5052
5153
52def case_1_test(method):54def case_1_test(method):
53    try:55    try:
54        method()56        method()
55        return False57        return False
56    except TypeError as e:58    except TypeError as e:
57        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE59        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE
58    except:60    except:
59        return False61        return False
6062
6163
62def is_interesting(current, method_name, recursion_depth):64def is_interesting(current, method_name, recursion_depth):
63    method = getattr(current, method_name)65    method = getattr(current, method_name)
64    if len(method_name) > 1 or not callable(method):66    if len(method_name) > 1 or not callable(method):
65        return False67        return False
6668
67    if recursion_depth > 0 and case_5_test(method):69    if recursion_depth > 0 and case_5_test(method):
68        return True70        return True
69    return (71    return (
70        case_4_test(method)72        case_4_test(method)
71        or case_3_test(method)73        or case_3_test(method)
72        or case_2_test(method)74        or case_2_test(method)
73        or case_1_test(method)75        or case_1_test(method)
74    )76    )
7577
7678
77def dfs(current, simbols_dict, recursion_depth):79def dfs(current, simbols_dict, recursion_depth):
78    for next_mod in dir(current):80    for next_mod in dir(current):
79        if is_interesting(current, next_mod, recursion_depth):81        if is_interesting(current, next_mod, recursion_depth):
80            simbols_dict[next_mod] = getattr(current, next_mod)82            simbols_dict[next_mod] = getattr(current, next_mod)
81        elif INTERESTING_PATHS_ENDS in next_mod:83        elif INTERESTING_PATHS_ENDS in next_mod:
82            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)84            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)
8385
8486
85def methodify():87def methodify():
86    simbols_dict = {}88    simbols_dict = {}
87    import secret89    import secret
8890
89    dfs(secret, simbols_dict, 0)91    dfs(secret, simbols_dict, 0)
9092
91    return (93    return (
92        simbols_dict["F"],94        simbols_dict["F"],
93        simbols_dict["N"],95        simbols_dict["N"],
94        simbols_dict["0"],96        simbols_dict["0"],
95        simbols_dict["M"],97        simbols_dict["M"],
96        simbols_dict["I"],98        simbols_dict["I"],
97        simbols_dict["0"],99        simbols_dict["0"],
98        simbols_dict["6"],100        simbols_dict["6"],
99        simbols_dict["0"],101        simbols_dict["0"],
100        simbols_dict["0"],102        simbols_dict["0"],
101        simbols_dict["1"],103        simbols_dict["1"],
102        simbols_dict["9"],104        simbols_dict["9"],
103        simbols_dict["7"],105        simbols_dict["7"],
104    )106    )
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op

f1import typesf1import types
22
33
4RANDOM_BIG_EVEN_NUMBER = 93849344RANDOM_BIG_EVEN_NUMBER = 9384934
5RANDOM_BIG_ODD_NUMBER = 7832467895RANDOM_BIG_ODD_NUMBER = 783246789
6RANDOM_STRING_1 = "@d5efSFRS//!!"6RANDOM_STRING_1 = "@d5efSFRS//!!"
7RANDOM_STRING_2 = "*dsa23w@sefS_RS//!!"7RANDOM_STRING_2 = "*dsa23w@sefS_RS//!!"
8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."8TEST_CASE_1_DEFAULT_MESSAGE = "Опаааааа, тука има нещо нередно."
9INTERESTING_PATHS_ENDS = "clue"9INTERESTING_PATHS_ENDS = "clue"
1010
1111
12def case_5_test(method):12def case_5_test(method):
13    return isinstance(method, types.FunctionType)13    return isinstance(method, types.FunctionType)
1414
1515
16def case_4_test(method):16def case_4_test(method):
17    try:17    try:
18        if (18        if (
19            method(RANDOM_STRING_1, RANDOM_STRING_2)19            method(RANDOM_STRING_1, RANDOM_STRING_2)
20            == RANDOM_STRING_1 + RANDOM_STRING_220            == RANDOM_STRING_1 + RANDOM_STRING_2
21        ):  # тези if-ове са грозни заради auto formater-а който ползвам и ме мързи да го сменя :)21        ):  # тези if-ове са грозни заради auto formater-а който ползвам и ме мързи да го сменя :)
22            return True22            return True
23    except:23    except:
24        return False24        return False
2525
2626
27def case_3_test(method):27def case_3_test(method):
28    try:28    try:
29        if (29        if (
30            method(RANDOM_BIG_ODD_NUMBER) == 030            method(RANDOM_BIG_ODD_NUMBER) == 0
31            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**231            and method(RANDOM_BIG_EVEN_NUMBER) == RANDOM_BIG_EVEN_NUMBER**2
32        ):32        ):
33            return True33            return True
34    except:34    except:
35        return False35        return False
3636
3737
38def case_2_test(method):38def case_2_test(method):
39    try:39    try:
40        method()40        method()
41        return False41        return False
42    except Exception:42    except Exception:
43        return False43        return False
44    except (KeyboardInterrupt, SystemExit):44    except (KeyboardInterrupt, SystemExit):
45        raise45        raise
46    except BaseException:46    except BaseException:
47        return True47        return True
48    except:  # това май е безполезно, но за всеки случай48    except:  # това май е безполезно, но за всеки случай
49        return False49        return False
5050
5151
52def case_1_test(method):52def case_1_test(method):
53    try:53    try:
54        method()54        method()
55        return False55        return False
56    except TypeError as e:56    except TypeError as e:
57        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE57        return str(e) == TEST_CASE_1_DEFAULT_MESSAGE
58    except:58    except:
59        return False59        return False
6060
6161
62def is_interesting(current, method_name, recursion_depth):62def is_interesting(current, method_name, recursion_depth):
t63    if method_name == "e":t
64        print("a")
65    method = getattr(current, method_name)63    method = getattr(current, method_name)
66    if len(method_name) > 1 or not callable(method):64    if len(method_name) > 1 or not callable(method):
67        return False65        return False
6866
69    if recursion_depth > 0 and case_5_test(method):67    if recursion_depth > 0 and case_5_test(method):
70        return True68        return True
71    return (69    return (
72        case_4_test(method)70        case_4_test(method)
73        or case_3_test(method)71        or case_3_test(method)
74        or case_2_test(method)72        or case_2_test(method)
75        or case_1_test(method)73        or case_1_test(method)
76    )74    )
7775
7876
79def dfs(current, simbols_dict, recursion_depth):77def dfs(current, simbols_dict, recursion_depth):
80    for next_mod in dir(current):78    for next_mod in dir(current):
81        if is_interesting(current, next_mod, recursion_depth):79        if is_interesting(current, next_mod, recursion_depth):
82            simbols_dict[next_mod] = getattr(current, next_mod)80            simbols_dict[next_mod] = getattr(current, next_mod)
83        elif INTERESTING_PATHS_ENDS in next_mod:81        elif INTERESTING_PATHS_ENDS in next_mod:
84            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)82            dfs(getattr(current, next_mod), simbols_dict, recursion_depth + 1)
8583
8684
87def methodify():85def methodify():
88    simbols_dict = {}86    simbols_dict = {}
89    import secret87    import secret
9088
91    dfs(secret, simbols_dict, 0)89    dfs(secret, simbols_dict, 0)
9290
93    return (91    return (
94        simbols_dict["F"],92        simbols_dict["F"],
95        simbols_dict["N"],93        simbols_dict["N"],
96        simbols_dict["0"],94        simbols_dict["0"],
97        simbols_dict["M"],95        simbols_dict["M"],
98        simbols_dict["I"],96        simbols_dict["I"],
99        simbols_dict["0"],97        simbols_dict["0"],
100        simbols_dict["6"],98        simbols_dict["6"],
101        simbols_dict["0"],99        simbols_dict["0"],
102        simbols_dict["0"],100        simbols_dict["0"],
103        simbols_dict["1"],101        simbols_dict["1"],
104        simbols_dict["9"],102        simbols_dict["9"],
105        simbols_dict["7"],103        simbols_dict["7"],
106    )104    )
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op