From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CC7E0E00D32; Tue, 10 May 2016 05:10:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [74.125.82.43 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 058C1E00D29 for ; Tue, 10 May 2016 05:10:19 -0700 (PDT) Received: by mail-wm0-f43.google.com with SMTP id a17so23936648wme.0 for ; Tue, 10 May 2016 05:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=47IEVpxGrkCxw0zw21XJSN+KCZ6ZvudjWf6XiVc9V/8=; b=j4nrPyegaQhE7o+kjdpIxU8C/pjLxXMpSubnt9oketkbMuL1Ldz2tq6Z9WCwa6SJlj 094IzHpqq7/HfT7yeRUO7uf8xcBy943U6CYpWl0Cri5sgOE86Y09Elmq88/LTWoVS4vw GTvVwAmXhjayYAAQihot3afSzAeU4qKaliFgQf5gJ03pyb7+h17O6zxGUjk62gSnHcqJ M+1hImEZiq3uMeZnClea4nv1CmKMHLVItB+kTY3ngQkmTM/8Nc48R3NX/Xxu3CNvVqz5 m3LLoxmQ+Wa5uYz5rkR7Fi+D50i/b0ER4Qj8Ev47VKFOTfvcTFh33flmeYSt+xe6bSyy Kzaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=47IEVpxGrkCxw0zw21XJSN+KCZ6ZvudjWf6XiVc9V/8=; b=iDWJhPDfsS0VW3+ZgWFwnZBsKuFdkVrk/zxvUPBWrmiwIIx6anY5NgsAV2khZ5e3ab lnhgbUhRB7fv+c+PtUDtdYKFKD21eIbB6uWz76lkDsggjokVr5AplecWktqrZhnFr6aS tHyJWQ+ucCZuv2qHMV1oINbq4/jS77R8ToEy9Br3xdkWrJNAPovYMBYn1zdoH+eg6aF3 45O8fsNE+601bTRejLcJSloSzaQArtYV1iwL3Lr3N8WWNru2oE4mwIL2bpEqRVWqc2O/ 8G1+sni2oGK7YnMUmWvfwA85zoH6Y16R+5zZtcLoSyg6J46ABqAGpT5r4yctugdewhjs Eafg== X-Gm-Message-State: AOPr4FWorBCwdMbwk0l0R1P+9j/DuP7z6d5qvrqBN2e4JMj2W5s7tk/QNUm7mve9RS8e1Kvl X-Received: by 10.194.58.195 with SMTP id t3mr37050162wjq.97.1462882218748; Tue, 10 May 2016 05:10:18 -0700 (PDT) Received: from [192.168.2.143] ([83.217.123.106]) by smtp.googlemail.com with ESMTPSA id he10sm2205207wjc.21.2016.05.10.05.10.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2016 05:10:18 -0700 (PDT) To: "Smith, Elliot" References: <1462807651-16627-1-git-send-email-michael.g.wood@intel.com> <1462807651-16627-6-git-send-email-michael.g.wood@intel.com> From: Michael Wood Message-ID: <5731CFA9.5010500@intel.com> Date: Tue, 10 May 2016 13:10:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Cc: toaster@yoctoproject.org Subject: Re: [PATCH 5/5] toaster: tests browser Add test for creating a project X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2016 12:10:22 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Upstreamed and pushed to toaster-next with the typo corrected On 09/05/16 17:22, Smith, Elliot wrote: > Looks good, but one typo (see below). > > I'm happy for you to upstream it. > > Elliot > > On 9 May 2016 at 16:27, Michael Wood > wrote: > > Add browser tests for creating a project and test validation of > duplicate project names. > > Signed-off-by: Michael Wood > > --- > .../toaster/tests/browser/test_new_project_page.py | 109 > +++++++++++++++++++++ > 1 file changed, 109 insertions(+) > create mode 100644 > bitbake/lib/toaster/tests/browser/test_new_project_page.py > > diff --git > a/bitbake/lib/toaster/tests/browser/test_new_project_page.py > b/bitbake/lib/toaster/tests/browser/test_new_project_page.py > new file mode 100644 > index 0000000..b9358ab > --- /dev/null > +++ b/bitbake/lib/toaster/tests/browser/test_new_project_page.py > @@ -0,0 +1,109 @@ > +#! /usr/bin/env python > +# ex:ts=4:sw=4:sts=4:et > +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- > +# > +# BitBake Toaster Implementation > +# > +# Copyright (C) 2013-2016 Intel Corporation > +# > +# This program is free software; you can redistribute it and/or > modify > +# it under the terms of the GNU General Public License version 2 as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public > License along > +# with this program; if not, write to the Free Software > Foundation, Inc., > +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + > +from django.core.urlresolvers import reverse > +from tests.browser.selenium_helpers import SeleniumTestCase > +from selenium.webdriver.support.ui import Select > + > +from orm.models import Project, Release, BitbakeVersion > + > + > +class TestNewProjectPage(SeleniumTestCase): > + """ Test project data at /project/X/ is displayed correctly """ > + > + def setUp(self): > + bitbake, c = BitbakeVersion.objects.get_or_create( > + name="master", > + giturl="git://master", > + branch="master", > + dirpath="master") > + > + release, c = Release.objects.get_or_create(name="msater", > + description="master" > + "release", > + branch_name="master", > + helptext="latest", > + bitbake_version=bitbake) > + > + self.release, c = Release.objects.get_or_create( > + name="msater2", > + description="master2" > + "release2", > + branch_name="master2", > + helptext="latest2", > + bitbake_version=bitbake) > + > + def test_create_new_project(self): > + """ Test creating a project """ > + > + project_name = "masterproject" > + > + url = reverse('newproject') > + self.get(url) > + > + self.enter_text('#new-project-name', project_name) > + > + select = Select(self.find('#projectversion')) > + select.select_by_value(str(self.release.pk > )) > + > + self.click("#create-project-button") > + > + # We should get redirected to the new project's page with the > + # notification at the top > + element = > self.wait_until_visible('#project-created-notification') > + > + self.assertTrue(project_name in element.text, > + "New project name not in new project > notification") > + > + self.assertTrue(Project.objects.filter(name=project_name).count(), > + "New project not found in database") > + > + def test_new_duplicates_project_name(self): > + """ > + Should not be able to create a new project whose name is > the same > + as an existing project > + """ > + > + project_name = "dupproject" > + > + Project.objects.create_project(name=project_name, > + release=self.release) > + > + url = reverse('newproject') > + self.get(url) > + > + self.enter_text('#new-project-name', project_name) > + > + select = Select(self.find('#projectversion')) > + select.select_by_value(str(self.release.pk > )) > + > + element = self.wait_until_visible('#hint-error-project-name') > + > + self.assertTrue(("Project names must be unique" in > element.text), > + "Did not find unqiue project name error > message") > > > TYPO: unqiue -> unique > > + > + # Try and click it anyway, if it submits we'll have a new > project in > + # the db and assert then > + self.click("#create-project-button") > + > + self.assertTrue( > + (Project.objects.filter(name=project_name).count() == 1), > + "New project not found in database") > -- > 2.7.4 > > -- > _______________________________________________ > toaster mailing list > toaster@yoctoproject.org > https://lists.yoctoproject.org/listinfo/toaster > > > > > -- > Elliot Smith > Software Engineer > Intel Open Source Technology Centre > > --------------------------------------------------------------------- > Intel Corporation (UK) Limited > Registered No. 1134945 (England) > Registered Office: Pipers Way, Swindon SN3 1RJ > VAT No: 860 2173 47 > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. >