File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -747,6 +747,46 @@ def test_add_url_constraint_wheel_with_extras(
747
747
}
748
748
749
749
750
+ def test_add_url_constraint_zip_with_subdir (
751
+ app : PoetryTestApplication ,
752
+ repo : TestRepository ,
753
+ tester : CommandTester ,
754
+ mocker : MockerFixture ,
755
+ ):
756
+ p = mocker .patch ("pathlib.Path.cwd" )
757
+ p .return_value = Path (__file__ ) / ".."
758
+
759
+ repo .add_package (get_package ("pendulum" , "1.4.4" ))
760
+
761
+ tester .execute (
762
+ "https://python-poetry.org/distributions/demo-0.1.0.zip#subdirectory=subdir"
763
+ )
764
+
765
+ expected = """\
766
+
767
+ Updating dependencies
768
+ Resolving dependencies...
769
+
770
+ Writing lock file
771
+
772
+ Package operations: 2 installs, 0 updates, 0 removals
773
+
774
+ • Installing pendulum (1.4.4)
775
+ • Installing demo\
776
+ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0.zip)
777
+ """
778
+ assert tester .io .fetch_output () == expected
779
+ assert tester .command .installer .executor .installations_count == 2
780
+
781
+ content = app .poetry .file .read ()["tool" ]["poetry" ]
782
+
783
+ assert "demo" in content ["dependencies" ]
784
+ assert content ["dependencies" ]["demo" ] == {
785
+ "url" : "https://python-poetry.org/distributions/demo-0.1.0.zip" ,
786
+ "subdirectory" : "subdir" ,
787
+ }
788
+
789
+
750
790
def test_add_constraint_with_python (
751
791
app : PoetryTestApplication , repo : TestRepository , tester : CommandTester
752
792
):
You can’t perform that action at this time.
0 commit comments