mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
bitbake: toaster: More linting of tests
Fix some more lint errors on the tests for toastergui. (Bitbake rev: a31710db562a91da8ef37f5cd2231132474f46da) 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>
This commit is contained in:
committed by
Richard Purdie
parent
7c8877efde
commit
d96cedf51f
@@ -433,6 +433,18 @@ class AllProjectsPageTests(TestCase):
|
|||||||
|
|
||||||
MACHINE_NAME = 'delorean'
|
MACHINE_NAME = 'delorean'
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
""" Add default project manually """
|
||||||
|
project = Project.objects.create_project(CLI_BUILDS_PROJECT_NAME, None)
|
||||||
|
self.default_project = project
|
||||||
|
self.default_project.is_default = True
|
||||||
|
self.default_project.save()
|
||||||
|
|
||||||
|
# this project is only set for some of the tests
|
||||||
|
self.project = None
|
||||||
|
|
||||||
|
self.release = None
|
||||||
|
|
||||||
def _add_build_to_default_project(self):
|
def _add_build_to_default_project(self):
|
||||||
""" Add a build to the default project (not used in all tests) """
|
""" Add a build to the default project (not used in all tests) """
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
@@ -458,16 +470,6 @@ class AllProjectsPageTests(TestCase):
|
|||||||
value=self.MACHINE_NAME)
|
value=self.MACHINE_NAME)
|
||||||
project_var.save()
|
project_var.save()
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
""" Add default project manually """
|
|
||||||
project = Project.objects.create_project(CLI_BUILDS_PROJECT_NAME, None)
|
|
||||||
self.default_project = project
|
|
||||||
self.default_project.is_default = True
|
|
||||||
self.default_project.save()
|
|
||||||
|
|
||||||
# this project is only set for some of the tests
|
|
||||||
self.project = None
|
|
||||||
|
|
||||||
def test_default_project_hidden(self):
|
def test_default_project_hidden(self):
|
||||||
""" The default project should be hidden if it has no builds """
|
""" The default project should be hidden if it has no builds """
|
||||||
params = {"count": 10, "orderby": "updated:-", "page": 1}
|
params = {"count": 10, "orderby": "updated:-", "page": 1}
|
||||||
@@ -573,17 +575,15 @@ class AllProjectsPageTests(TestCase):
|
|||||||
# link for default project
|
# link for default project
|
||||||
row = soup.find('tr', attrs={'data-project': self.default_project.id})
|
row = soup.find('tr', attrs={'data-project': self.default_project.id})
|
||||||
cell = row.find('td', attrs={'data-project-field': 'name'})
|
cell = row.find('td', attrs={'data-project-field': 'name'})
|
||||||
url = cell.find('a')['href']
|
|
||||||
expected_url = reverse('projectbuilds', args=(self.default_project.id,))
|
expected_url = reverse('projectbuilds', args=(self.default_project.id,))
|
||||||
self.assertEqual(url, expected_url,
|
self.assertEqual(cell.find('a')['href'], expected_url,
|
||||||
'link on default project name should point to builds')
|
'link on default project name should point to builds')
|
||||||
|
|
||||||
# link for other project
|
# link for other project
|
||||||
row = soup.find('tr', attrs={'data-project': self.project.id})
|
row = soup.find('tr', attrs={'data-project': self.project.id})
|
||||||
cell = row.find('td', attrs={'data-project-field': 'name'})
|
cell = row.find('td', attrs={'data-project-field': 'name'})
|
||||||
url = cell.find('a')['href']
|
|
||||||
expected_url = reverse('project', args=(self.project.id,))
|
expected_url = reverse('project', args=(self.project.id,))
|
||||||
self.assertEqual(url, expected_url,
|
self.assertEqual(cell.find('a')['href'], expected_url,
|
||||||
'link on project name should point to configuration')
|
'link on project name should point to configuration')
|
||||||
|
|
||||||
class ProjectBuildsPageTests(TestCase):
|
class ProjectBuildsPageTests(TestCase):
|
||||||
@@ -640,13 +640,6 @@ class ProjectBuildsPageTests(TestCase):
|
|||||||
"outcome": Build.IN_PROGRESS
|
"outcome": Build.IN_PROGRESS
|
||||||
}
|
}
|
||||||
|
|
||||||
self.default_project_build_success = {
|
|
||||||
"project": self.default_project,
|
|
||||||
"started_on": now,
|
|
||||||
"completed_on": now,
|
|
||||||
"outcome": Build.SUCCEEDED
|
|
||||||
}
|
|
||||||
|
|
||||||
def _get_rows_for_project(self, project_id):
|
def _get_rows_for_project(self, project_id):
|
||||||
""" Helper to retrieve HTML rows for a project """
|
""" Helper to retrieve HTML rows for a project """
|
||||||
url = reverse("projectbuilds", args=(project_id,))
|
url = reverse("projectbuilds", args=(project_id,))
|
||||||
|
|||||||
Reference in New Issue
Block a user