forked from conan-io/conan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/min conan version (conan-io#7360)
* min_conan_version proposal * removed wrong test * fix test * made min_conan_version global * required_conan_version is now a range * renamed tests * review
- Loading branch information
1 parent
eb5ff51
commit 72b12e7
Showing
5 changed files
with
67 additions
and
20 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
34 changes: 34 additions & 0 deletions
34
conans/test/functional/conanfile/required_conan_version_test.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,34 @@ | ||
import textwrap | ||
import unittest | ||
|
||
import mock | ||
|
||
from conans import __version__ | ||
from conans.test.utils.tools import TestClient | ||
|
||
|
||
class RequiredConanVersionTest(unittest.TestCase): | ||
|
||
def required_conan_version_test(self): | ||
client = TestClient() | ||
conanfile = textwrap.dedent(""" | ||
from conans import ConanFile | ||
required_conan_version = ">=100.0" | ||
class Lib(ConanFile): | ||
pass | ||
""") | ||
client.save({"conanfile.py": conanfile}) | ||
client.run("export . pkg/1.0@", assert_error=True) | ||
self.assertIn("Current Conan version (%s) does not satisfy the defined one (>=100.0)" | ||
% __version__, client.out) | ||
client.run("inspect . ", assert_error=True) | ||
self.assertIn("Current Conan version (%s) does not satisfy the defined one (>=100.0)" | ||
% __version__, client.out) | ||
with mock.patch("conans.client.conf.required_version.client_version", "101.0"): | ||
client.run("export . pkg/1.0@") | ||
|
||
client.run("install pkg/1.0@", assert_error=True) | ||
self.assertIn("Current Conan version (%s) does not satisfy the defined one (>=100.0)" | ||
% __version__, client.out) |
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