summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/tests.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-02 14:23:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:59:59 +0100
commit76702347a8f51871106e32f81e459c5548482e3d (patch)
treec31bba9ec789dddfb5bfb3bee3ac35114504a4f8 /bitbake/lib/toaster/toastergui/tests.py
parentda4c6144f1125ac94f1ba515f97a433a983b7662 (diff)
downloadpoky-76702347a8f51871106e32f81e459c5548482e3d.tar.gz
bitbake: toaster: Hide tabs and add info popups for command line builds
Command line builds don't have a configuration or layers which can be modified through Toaster. Change the project builds page for the command line builds project, to hide the tabs and add some info popups in appropriate places on that page. [YOCTO #8231] (Bitbake rev: 565611749d47c915035890db60d19ab2fca7c42e) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tests.py')
-rw-r--r--bitbake/lib/toaster/toastergui/tests.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py
index 3753748b75..4b93415e1e 100644
--- a/bitbake/lib/toaster/toastergui/tests.py
+++ b/bitbake/lib/toaster/toastergui/tests.py
@@ -596,8 +596,18 @@ class ProjectBuildsPageTests(TestCase):
596 bitbake_version=bbv) 596 bitbake_version=bbv)
597 self.project1 = Project.objects.create_project(name=PROJECT_NAME, 597 self.project1 = Project.objects.create_project(name=PROJECT_NAME,
598 release=release) 598 release=release)
599 self.project1.save()
600
599 self.project2 = Project.objects.create_project(name=PROJECT_NAME, 601 self.project2 = Project.objects.create_project(name=PROJECT_NAME,
600 release=release) 602 release=release)
603 self.project2.save()
604
605 self.default_project = Project.objects.create_project(
606 name=CLI_BUILDS_PROJECT_NAME,
607 release=release
608 )
609 self.default_project.is_default = True
610 self.default_project.save()
601 611
602 # parameters for builds to associate with the projects 612 # parameters for builds to associate with the projects
603 now = timezone.now() 613 now = timezone.now()
@@ -630,6 +640,13 @@ class ProjectBuildsPageTests(TestCase):
630 "outcome": Build.IN_PROGRESS 640 "outcome": Build.IN_PROGRESS
631 } 641 }
632 642
643 self.default_project_build_success = {
644 "project": self.default_project,
645 "started_on": now,
646 "completed_on": now,
647 "outcome": Build.SUCCEEDED
648 }
649
633 def _get_rows_for_project(self, project_id): 650 def _get_rows_for_project(self, project_id):
634 """ Helper to retrieve HTML rows for a project """ 651 """ Helper to retrieve HTML rows for a project """
635 url = reverse("projectbuilds", args=(project_id,)) 652 url = reverse("projectbuilds", args=(project_id,))
@@ -681,6 +698,30 @@ class ProjectBuildsPageTests(TestCase):
681 result = re.findall('^ +bash:clean$', response.content, re.MULTILINE) 698 result = re.findall('^ +bash:clean$', response.content, re.MULTILINE)
682 self.assertEqual(len(result), 2) 699 self.assertEqual(len(result), 2)
683 700
701 def test_cli_builds_hides_tabs(self):
702 """
703 Display for command line builds should hide tabs;
704 note that the latest builds section is already tested in
705 AllBuildsPageTests, as the template is the same
706 """
707 url = reverse("projectbuilds", args=(self.default_project.id,))
708 response = self.client.get(url, follow=True)
709 soup = BeautifulSoup(response.content)
710 tabs = soup.select('#project-topbar')
711 self.assertEqual(len(tabs), 0,
712 'should be no top bar shown for command line builds')
713
714 def test_non_cli_builds_has_tabs(self):
715 """
716 Non-command-line builds projects should show the tabs
717 """
718 url = reverse("projectbuilds", args=(self.project1.id,))
719 response = self.client.get(url, follow=True)
720 soup = BeautifulSoup(response.content)
721 tabs = soup.select('#project-topbar')
722 self.assertEqual(len(tabs), 1,
723 'should be a top bar shown for non-command-line builds')
724
684class AllBuildsPageTests(TestCase): 725class AllBuildsPageTests(TestCase):
685 """ Tests for all builds page /builds/ """ 726 """ Tests for all builds page /builds/ """
686 727