remove server and  'self.' from places where it is not needed
@@ -12,9 +12,7 @@ from conans.paths import CONAN_MANIFEST
class InstallMissingDependency(unittest.TestCase):
def missing_dep_test(self):
- test_server = TestServer()
- self.servers = {"myremote": test_server}
- self.client = TestClient(servers=self.servers, users={"myremote": [("lasote", "mypass")]})
+ client = TestClient(users={"myremote": [("lasote", "mypass")]})
# Create deps packages
dep1_conanfile = """from conans import ConanFile
@@ -29,28 +27,27 @@ class Dep2Pkg(ConanFile):
requires = "dep1/1.0@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")
+ client.save({"conanfile.py": dep1_conanfile}, clean_first=True)
+ client.run("create . dep1/1.0@lasote/testing")
+ client.run("create . dep1/2.0@lasote/testing")
- self.client.save({"conanfile.py": dep2_conanfile}, clean_first=True)
- self.client.run("create . lasote/testing")
+ client.save({"conanfile.py": dep2_conanfile}, clean_first=True)
+ client.run("create . lasote/testing")
+ # Create final package
foo_conanfile = """from conans import ConanFile
class FooPkg(ConanFile):
name = "foo"
version = "1.0"
requires = "dep1/{dep1_version}@lasote/testing", "dep2/1.0@lasote/testing"
"""
- self.client.save({"conanfile.py": foo_conanfile.format(dep1_version="1.0")},
- clean_first=True)
- error = self.client.run("create . lasote/testing")
- self.assertFalse(error)
-
- self.client.save({"conanfile.py": foo_conanfile.format(dep1_version="2.0")},
- clean_first=True)
- error = self.client.run("create . lasote/testing", ignore_error=True)
+ client.save({"conanfile.py": foo_conanfile.format(dep1_version="1.0")}, clean_first=True)
+ client.run("create . lasote/testing")
+
+ # Bump version of one dependency
+ client.save({"conanfile.py": foo_conanfile.format(dep1_version="2.0")}, clean_first=True)
+ error = 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)
+ self.assertIn("Can't find a 'dep2/1.0@lasote/testing' package", client.user_io.out)
+ self.assertIn("- Dependencies: dep1/2.0@lasote/testing", client.user_io.out)
