Merge "Add proper __repr__ to merger repo"
This commit is contained in:
commit
ddf3afce0a
|
@ -296,6 +296,12 @@ class TestMergerRepo(ZuulTestCase):
|
|||
self.assertEqual(sorted(['messy1.txt', 'messy2.txt']),
|
||||
sorted(changed_files))
|
||||
|
||||
def test_repo_repr(self):
|
||||
local_path = "/dev/null"
|
||||
repo = Repo("remote", local_path,
|
||||
"none@example.org", "User Name", "0", "0")
|
||||
self.assertIn(local_path, repr(repo))
|
||||
|
||||
|
||||
class TestMergerWithAuthUrl(ZuulTestCase):
|
||||
config_file = 'zuul-github-driver.conf'
|
||||
|
|
|
@ -112,6 +112,9 @@ class Repo(object):
|
|||
except Exception:
|
||||
self.log.exception("Unable to initialize repo for %s" % remote)
|
||||
|
||||
def __repr__(self):
|
||||
return "<Repo {} {}>".format(hex(id(self)), self.local_path)
|
||||
|
||||
def _setup_known_hosts(self):
|
||||
url = urlparse(self.remote_url)
|
||||
if 'ssh' not in url.scheme:
|
||||
|
|
Loading…
Reference in New Issue