diff options
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 4d1549b0a9..53012b43cd 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
| @@ -21,12 +21,14 @@ | |||
| 21 | 21 | ||
| 22 | """Test cases for Toaster GUI and ReST.""" | 22 | """Test cases for Toaster GUI and ReST.""" |
| 23 | 23 | ||
| 24 | import re | ||
| 25 | |||
| 24 | from django.test import TestCase | 26 | from django.test import TestCase |
| 25 | from django.core.urlresolvers import reverse | 27 | from django.core.urlresolvers import reverse |
| 26 | from django.utils import timezone | 28 | from django.utils import timezone |
| 27 | from orm.models import Project, Release, BitbakeVersion, ProjectTarget | 29 | from orm.models import Project, Release, BitbakeVersion, ProjectTarget |
| 28 | from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build | 30 | from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build |
| 29 | from orm.models import Layer_Version, Recipe, Machine, ProjectLayer | 31 | from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target |
| 30 | import json | 32 | import json |
| 31 | from bs4 import BeautifulSoup | 33 | from bs4 import BeautifulSoup |
| 32 | 34 | ||
| @@ -376,4 +378,22 @@ class ProjectBuildsDisplayTest(TestCase): | |||
| 376 | build2b = Build.objects.create(**self.project2_build_in_progress) | 378 | build2b = Build.objects.create(**self.project2_build_in_progress) |
| 377 | 379 | ||
| 378 | build_rows = self._get_rows_for_project(self.project1.id) | 380 | build_rows = self._get_rows_for_project(self.project1.id) |
| 379 | self.assertEqual(len(build_rows), 2) \ No newline at end of file | 381 | self.assertEqual(len(build_rows), 2) |
| 382 | |||
| 383 | def test_show_tasks_in_projectbuilds(self): | ||
| 384 | build = Build.objects.create(**self.project1_build_success) | ||
| 385 | target = Target.objects.create(build=build, target='bash', | ||
| 386 | task='clean') | ||
| 387 | url = reverse("projectbuilds", args=(self.project1.id,)) | ||
| 388 | response = self.client.get(url, follow=True) | ||
| 389 | result = re.findall('^ +bash:clean$', response.content, re.MULTILINE) | ||
| 390 | self.assertEqual(len(result), 1) | ||
| 391 | |||
| 392 | def test_show_tasks_in_allbuilds(self): | ||
| 393 | build = Build.objects.create(**self.project1_build_success) | ||
| 394 | target = Target.objects.create(build=build, target='bash', | ||
| 395 | task='clean') | ||
| 396 | url = reverse("all-builds") | ||
| 397 | response = self.client.get(url, follow=True) | ||
| 398 | result = re.findall('bash:clean', response.content, re.MULTILINE) | ||
| 399 | self.assertEqual(len(result), 3) | ||
