791be481c4a0102042dc0a502b08ba5cc6a85987,src/python/pants/backend/python/rules/inject_init_test.py,InjectInitTest,assert_injected,#,28
Before Change
self.make_snapshot({fp: "// python code" for fp in original_files}),
sources_stripped=sources_stripped,
)
result = self.request_single_product(
InitInjectedSnapshot,
Params(
request, create_options_bootstrapper(args=["--source-root-patterns=["src/python"]"])
),
).snapshot
assert list(result.files) == sorted(
[*original_files, *expected_added, *expected_discovered]
)
// Ensure all original `__init__.py` are preserved with their original content.
materialized_original_inits = [
fc
for fc in self.request_single_product(FilesContent, result.digest)
if fc.path.endswith("__init__.py")
and (fc.path in original_files or fc.path in expected_discovered)
]
for original_init in materialized_original_inits:
assert (
original_init.content == b"// python code"
), f"{original_init} does not have its original content preserved."
After Change
bootstrapper = create_options_bootstrapper(
args=["--source-root-patterns=["src/python", "tests/python"]"]
)
result = self.request_single_product(
InitInjectedSnapshot, Params(request, bootstrapper)
).snapshot
assert list(result.files) == sorted([*original_declared_files, *expected_discovered])
materialized_result = self.request_single_product(FilesContent, result.digest)
for file_content in materialized_result:
path = file_content.path
if not path.endswith("__init__.py"):
continue
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: pantsbuild/pants
Commit Name: 791be481c4a0102042dc0a502b08ba5cc6a85987
Time: 2020-06-29
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/rules/inject_init_test.py
Class Name: InjectInitTest
Method Name: assert_injected
Project Name: pantsbuild/pants
Commit Name: 0bfa6dbdc43587f24f2f65fcf3e63266833c5aa0
Time: 2020-01-02
Author: ericarellano@me.com
File Name: src/python/pants/backend/python/lint/black/rules_integration_test.py
Class Name: BlackIntegrationTest
Method Name: run_black
Project Name: pantsbuild/pants
Commit Name: 0bfa6dbdc43587f24f2f65fcf3e63266833c5aa0
Time: 2020-01-02
Author: ericarellano@me.com
File Name: src/python/pants/backend/python/lint/isort/rules_integration_test.py
Class Name: IsortIntegrationTest
Method Name: run_isort