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)
        ]

After Change


        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
            assert path in original_declared_files or path in expected_discovered
            expected = b"// declared" if path in original_declared_files else b"// undeclared"
            assert file_content.content == expected
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: 9fc01086d3e6b7d1e659b7fbca22a21f93e191d8
Time: 2020-01-10
Author: ericarellano@me.com
File Name: src/python/pants/backend/python/lint/isort/rules_integration_test.py
Class Name: IsortIntegrationTest
Method Name: run_isort


Project Name: pantsbuild/pants
Commit Name: 9fc01086d3e6b7d1e659b7fbca22a21f93e191d8
Time: 2020-01-10
Author: ericarellano@me.com
File Name: src/python/pants/backend/python/lint/black/rules_integration_test.py
Class Name: BlackIntegrationTest
Method Name: run_black