-
Notifications
You must be signed in to change notification settings - Fork 990
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[develop2] Implement forcing of download sources (#13003)
* [develop2] install sources * add test * Update conan/api/subapi/install.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> --------- Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
- Loading branch information
1 parent
7c7e1c3
commit ad7fd95
Showing
6 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
conans/test/integration/command/test_forced_download_source.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import textwrap | ||
|
||
import pytest | ||
|
||
from conans.test.utils.tools import TestClient | ||
|
||
|
||
@pytest.fixture() | ||
def client(): | ||
c = TestClient(default_server_user=True) | ||
dep = textwrap.dedent(""" | ||
from conan import ConanFile | ||
class Dep(ConanFile): | ||
name = "dep" | ||
version = "0.1" | ||
def source(self): | ||
self.output.info("RUNNING SOURCE!!") | ||
""") | ||
|
||
c.save({"dep/conanfile.py": dep}) | ||
c.run("create dep") | ||
c.run("upload * -c -r=default") | ||
c.run("remove * -c") | ||
return c | ||
|
||
|
||
def test_install(client): | ||
client.run("install --requires=dep/0.1") | ||
assert "RUNNING SOURCE" not in client.out | ||
client.run("install --requires=dep/0.1 -c tools.build:download_source=True") | ||
assert "RUNNING SOURCE" in client.out | ||
client.run("install --requires=dep/0.1 -c tools.build:download_source=True") | ||
assert "RUNNING SOURCE" not in client.out | ||
|
||
|
||
def test_info(client): | ||
client.run("graph info --requires=dep/0.1") | ||
assert "RUNNING SOURCE" not in client.out | ||
client.run("graph info --requires=dep/0.1 -c tools.build:download_source=True") | ||
assert "RUNNING SOURCE" in client.out | ||
client.run("graph info --requires=dep/0.1 -c tools.build:download_source=True") | ||
assert "RUNNING SOURCE" not in client.out |
File renamed without changes.