Skip to content

Commit

Permalink
Test/conan info not check server (#12807)
Browse files Browse the repository at this point in the history
* test that conan info will not check server if pkgs in cache

* more checks
  • Loading branch information
memsharded authored Dec 29, 2022
1 parent 56d7221 commit b560c75
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions conans/test/integration/command/info/info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,3 +747,26 @@ def build_requirements(self):
client.run("info . " + args)
assert "AttributeError: 'HelloConan' object has no attribute 'tested_reference_str'"\
not in client.out


def test_info_not_hit_server():
c = TestClient(default_server_user=True)
c.save({"pkg/conanfile.py": GenConanfile("pkg", "0.1"),
"consumer/conanfile.py": GenConanfile("consumer", "0.1").with_require("pkg/0.1")})
c.run("create pkg")
c.run("create consumer")
c.run("upload * -r=default --all -c")
c.run("remove * -f")
c.run("install consumer/0.1@")
assert "Downloaded" in c.out
# break the server to make sure it is not being contacted at all
c.servers["default"] = None
c.run("info consumer/0.1@")
assert "Downloaded" not in c.out
c.run("remove pkg* -f")
c.run("info consumer/0.1@", assert_error=True)
assert "ERROR: 'NoneType' object " in c.out
c.run("remote disable *")
c.run("info consumer/0.1@", assert_error=True)
assert "ERROR: 'NoneType' object " not in c.out
assert "ERROR: No remote defined" in c.out

0 comments on commit b560c75

Please sign in to comment.