def test_that_path_paths_from_requirement_files_are_preserved_in_sources( collector: RequirementsCollector, tmpdir: Any) -> None: with current_working_directory(str(tmpdir)): requirements_file_path = tmpdir.join("requirements.txt") with open(requirements_file_path, "w") as f: print("path/to/egg#egg=testegg", file=f) collector.add_file(str(requirements_file_path)) testegg_source = collector.sources()["testegg"] assert isinstance(testegg_source, PathSource) assert testegg_source.path == "path/to/egg"
def test_that_relative_paths_are_preserved_in_sources( collector: RequirementsCollector, ) -> None: collector.add_line("path/to/egg#egg=testegg") testegg_source = collector.sources()["testegg"] assert isinstance(testegg_source, PathSource) assert testegg_source.path == "path/to/egg"
def test_that_sources_can_be_extracted_from_a_collector( collector: RequirementsCollector, ) -> None: collector.add_line("path/to/egg#egg=testegg") assert "testegg" in collector.sources()