-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/support require override (#597)
Co-authored-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
6069d0e
commit 507826a
Showing
5 changed files
with
63 additions
and
4 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
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 unittest | ||
|
||
from cpt.test.utils.tools import TestClient | ||
from cpt.test.test_client.tools import get_patched_multipackager | ||
|
||
|
||
class RequireOverridesTest(unittest.TestCase): | ||
def test_require_overrides(self): | ||
conanfile_bar = """from conans import ConanFile | ||
class Pkg(ConanFile): | ||
name = "bar" | ||
version = "0.1.0" | ||
def build(self): | ||
pass | ||
""" | ||
|
||
conanfile = """from conans import ConanFile | ||
class Pkg(ConanFile): | ||
name = "foobar" | ||
version = "2.0" | ||
requires = "bar/0.1.0@foo/stable" | ||
def build(self): | ||
self.output.warn("BUILDING") | ||
""" | ||
|
||
client = TestClient() | ||
client.save({"conanfile_bar.py": conanfile_bar}) | ||
client.run("export conanfile_bar.py foo/stable") | ||
client.run("export conanfile_bar.py foo/testing") | ||
|
||
client.save({"conanfile.py": conanfile}) | ||
mulitpackager = get_patched_multipackager(client, username="user", | ||
channel="testing", | ||
build_policy="missing", | ||
require_overrides=["bar/0.1.0@foo/testing"], | ||
exclude_vcvars_precommand=True) | ||
mulitpackager.add({}, {}) | ||
mulitpackager.run() | ||
|
||
self.assertIn("requirement bar/0.1.0@foo/stable overridden by your conanfile to bar/0.1.0@foo/testing", client.out) |