From nobody Tue May 13 20:00:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1532664009537801.436977061367; Thu, 26 Jul 2018 21:00:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 573A432B690; Fri, 27 Jul 2018 04:00:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 422F261289; Fri, 27 Jul 2018 04:00:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 302A34BB78; Fri, 27 Jul 2018 04:00:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6R406A3018717 for ; Fri, 27 Jul 2018 00:00:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id CC3BC111C4AB; Fri, 27 Jul 2018 04:00:06 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-150.pek2.redhat.com [10.72.12.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25844111DD04; Fri, 27 Jul 2018 04:00:00 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 27 Jul 2018 11:59:31 +0800 Message-Id: <20180727035934.32555-9-famz@redhat.com> In-Reply-To: <20180727035934.32555-1-famz@redhat.com> References: <20180727035934.32555-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH v2 08/11] tests: Create repo automatically for projects X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 27 Jul 2018 04:00:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" They are likely useful for git and testing related cases, so do it automatically. Signed-off-by: Fam Zheng --- tests/patchewtest.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/patchewtest.py b/tests/patchewtest.py index 9d34555..d41793e 100644 --- a/tests/patchewtest.py +++ b/tests/patchewtest.py @@ -118,8 +118,12 @@ class PatchewTestCase(django.test.LiveServerTestCase): return Project.objects.all() =20 def add_project(self, name, mailing_list=3D"", git_repo=3D""): - p =3D Project(name=3Dname, mailing_list=3Dmailing_list, git=3Dgit_= repo) + p =3D Project(name=3Dname, mailing_list=3Dmailing_list, git=3Dgit_= repo or self.create_git_repo(name)) p.save() + push_repo =3D self.create_git_repo(name + "_push") + p.set_property("git.push_to", push_repo) + p.set_property("git.public_repo", push_repo) + p.set_property("git.url_template", push_repo) return p =20 def api_login(self): @@ -146,10 +150,13 @@ class PatchewTestCase(django.test.LiveServerTestCase): repo =3D os.path.join(self.get_tmpdir(), name) os.mkdir(repo) subprocess.check_output(["git", "init"], cwd=3Drepo) - subprocess.check_output(["touch", "foo"], cwd=3Drepo) + subprocess.check_output(["touch", "foo", "bar"], cwd=3Drepo) subprocess.check_output(["git", "add", "foo"], cwd=3Drepo) subprocess.check_output(["git", "commit", "-m", "initial commit"], cwd=3Drepo) + subprocess.check_output(["git", "add", "bar"], cwd=3Drepo) + subprocess.check_output(["git", "commit", "-m", "another commit"], + cwd=3Drepo) return repo =20 def parse_args(): --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel