summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-22 10:34:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 22:41:04 +0100
commit092b1a9eebbd3f0747f6152c63182f18bccb2054 (patch)
tree908591f0455b9c58365152a09a08c28e4e663f08 /lib
parent3c196c15f0ae4c6ac2b92e0a75562962f3da0089 (diff)
downloadbitbake-092b1a9eebbd3f0747f6152c63182f18bccb2054.zip
toaster: add 2 UI tests
Tested that UI shows task names for the builds in both all-builds and projectbuilds views. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/toaster/toastergui/tests.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/toaster/toastergui/tests.py b/lib/toaster/toastergui/tests.py
index 4d1549b0..53012b43 100644
--- a/lib/toaster/toastergui/tests.py
+++ b/lib/toaster/toastergui/tests.py
@@ -21,12 +21,14 @@
"""Test cases for Toaster GUI and ReST."""
+import re
+
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils import timezone
from orm.models import Project, Release, BitbakeVersion, ProjectTarget
from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build
-from orm.models import Layer_Version, Recipe, Machine, ProjectLayer
+from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
import json
from bs4 import BeautifulSoup
@@ -376,4 +378,22 @@ class ProjectBuildsDisplayTest(TestCase):
build2b = Build.objects.create(**self.project2_build_in_progress)
build_rows = self._get_rows_for_project(self.project1.id)
- self.assertEqual(len(build_rows), 2) \ No newline at end of file
+ self.assertEqual(len(build_rows), 2)
+
+ def test_show_tasks_in_projectbuilds(self):
+ build = Build.objects.create(**self.project1_build_success)
+ target = Target.objects.create(build=build, target='bash',
+ task='clean')
+ url = reverse("projectbuilds", args=(self.project1.id,))
+ response = self.client.get(url, follow=True)
+ result = re.findall('^ +bash:clean$', response.content, re.MULTILINE)
+ self.assertEqual(len(result), 1)
+
+ def test_show_tasks_in_allbuilds(self):
+ build = Build.objects.create(**self.project1_build_success)
+ target = Target.objects.create(build=build, target='bash',
+ task='clean')
+ url = reverse("all-builds")
+ response = self.client.get(url, follow=True)
+ result = re.findall('bash:clean', response.content, re.MULTILINE)
+ self.assertEqual(len(result), 3)