示例#1
0
    def test_include(self, tmpdir):
        inc_path = create_file(tmpdir, 'requirements_inc.txt', 'other-package==1.0')
        path = create_file(tmpdir, 'requirements.txt', '-r {0}'.format(inc_path))

        assert read_pip(path) == [
            '-r {0}'.format(inc_path),
            'other-package==1.0',
        ]
示例#2
0
    def test_include(self, tmp_path):
        requirements_inc = tmp_path / "requirements_inc.txt"
        requirements_inc.write_text("other-package==1.0\n")
        requirements = tmp_path / "requirements.txt"
        requirements.write_text(f"-r {requirements_inc}\n")

        assert read_pip(str(requirements)) == [
            f"-r {requirements_inc}",
            "other-package==1.0",
        ]
示例#3
0
 def test_empty(self, tmp_path):
     requirements = tmp_path / "requirements.txt"
     requirements.write_text("\n")
     assert read_pip(str(requirements)) == [""]
示例#4
0
 def test_read(self, tmp_path):
     requirements = tmp_path / "requirements.txt"
     requirements.write_text("package1==1.0\npackage2==1.1\n")
     assert read_pip(
         str(requirements)) == ["package1==1.0", "package2==1.1"]
示例#5
0
 def test_empty(self, tmpdir):
     path = create_file(tmpdir, "requirements.txt", "")
     assert read_pip(path) == [""]
示例#6
0
    def test_include(self, tmpdir):
        inc_path = create_file(tmpdir, "requirements_inc.txt", "other-package==1.0")
        path = create_file(tmpdir, "requirements.txt", "-r {}".format(inc_path))

        assert read_pip(path) == ["-r {}".format(inc_path), "other-package==1.0"]
示例#7
0
 def test_read(self, tmpdir):
     path = create_file(tmpdir, "requirements.txt", "package1==1.0\npackage2==1.1")
     assert read_pip(path) == ["package1==1.0", "package2==1.1"]
示例#8
0
 def test_empty(self, tmpdir):
     path = create_file(tmpdir, 'requirements.txt', '')
     assert read_pip(path) == ['']
示例#9
0
 def test_read(self, tmpdir):
     path = create_file(tmpdir, 'requirements.txt', 'package1==1.0\npackage2==1.1')
     assert read_pip(path) == ['package1==1.0', 'package2==1.1']