MCPcopy Create free account
hub / github.com/Persper/code-analytics / test_patch_parser

Function test_patch_parser

test/test_graphs/test_detect_change.py:50–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 *func_ranges_result, *parsing_result))
49
50def test_patch_parser():
51 parser = PatchParser()
52
53 patch2_truth = (
54 [[0, 6]],
55 []
56 )
57 with open(os.path.join(dir_path, 'example2.patch'), 'r') as f:
58 example2_patch = f.read()
59 parsing_result = parser.parse(example2_patch)
60 assert(parsing_result == patch2_truth)
61
62 # view patch3_truth here
63 # https://github.com/UltimateBeaver/test_feature_branch/commit/caaac10f604ea7ac759c2147df8fb2b588ee2a27
64 patch3_truth = (
65 [[10, 4], [12, 1], [14, 1], [17, 13]],
66 [[9, 10], [12, 12], [14, 14]]
67 )
68 with open(os.path.join(dir_path, 'example3.patch'), 'r') as f:
69 example3_patch = f.read()
70 parsing_result = parser.parse(example3_patch)
71 assert(parsing_result == patch3_truth)
72
73 # view patch4_truth here
74 # https://github.com/UltimateBeaver/test_feature_branch/commit/364d5cc49aeb2e354da458924ce84c0ab731ac77
75 patch4_truth = (
76 [[0, 27]],
77 []
78 )
79 with open(os.path.join(dir_path, 'example4.patch'), 'r') as f:
80 example4_patch = f.read()
81 parsing_result = parser.parse(example4_patch)
82 assert(parsing_result == patch4_truth)
83
84
85

Callers

nothing calls this directly

Calls 2

parseMethod · 0.95
PatchParserClass · 0.90

Tested by

no test coverage detected