fixes according to review: code simplification
@@ -9,9 +9,9 @@ import time
from conans.paths import CONAN_MANIFEST
-class InstallMissingDependencie(unittest.TestCase):
+class InstallMissingDependency(unittest.TestCase):
- def setUp(self):
+ def missing_dep_test(self):
test_server = TestServer()
self.servers = {"myremote": test_server}
self.client = TestClient(servers=self.servers, users={"myremote": [("lasote", "mypass")]})
@@ -20,7 +20,6 @@ class InstallMissingDependencie(unittest.TestCase):
dep1_conanfile = """from conans import ConanFile
class Dep1Pkg(ConanFile):
name = "dep1"
- version = "{version}"
"""
dep2_conanfile = """from conans import ConanFile
@@ -30,16 +29,13 @@ class Dep2Pkg(ConanFile):
requires = "dep1/1.0@lasote/testing"
"""
- self.client.save({"conanfile.py": dep1_conanfile.format(version="1.0")}, clean_first=True)
- self.client.run("create . lasote/testing")
-
- self.client.save({"conanfile.py": dep1_conanfile.format(version="2.0")}, clean_first=True)
- self.client.run("create . lasote/testing")
+ self.client.save({"conanfile.py": dep1_conanfile}, clean_first=True)
+ self.client.run("create . dep1/1.0@lasote/testing")
+ self.client.run("create . dep1/2.0@lasote/testing")
self.client.save({"conanfile.py": dep2_conanfile}, clean_first=True)
self.client.run("create . lasote/testing")
- def missing_dep_test(self):
foo_conanfile = """from conans import ConanFile
class FooPkg(ConanFile):
name = "foo"
@@ -53,7 +49,8 @@ class FooPkg(ConanFile):
self.client.save({"conanfile.py": foo_conanfile.format(dep1_version="2.0")},
clean_first=True)
- self.client.run("create . lasote/testing", ignore_error=True)
+ error = self.client.run("create . lasote/testing", ignore_error=True)
+ self.assertTrue(error)
self.assertIn("Can't find a 'dep2/1.0@lasote/testing' package", self.client.user_io.out)
self.assertIn("- Dependencies: dep1/2.0@lasote/testing", self.client.user_io.out)
