diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-08-10 18:27:18 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-10 13:58:02 -0700 |
commit | a16e0b4014173af46ef80d643bb71055219b0dab (patch) | |
tree | 9f864b3e1d3a83ee8dfc513a8380323de6e649f1 /bitbake/lib | |
parent | 5fe1c196445d7719474f9b5214817bd00591929b (diff) | |
download | poky-a16e0b4014173af46ef80d643bb71055219b0dab.tar.gz |
bitbake: toaster: reduced amount of instance attributes
Used local variables instead of instance attributes in ViewTests.setUp
Fixed pylint warning:
Too many instance attributes (9/7) (too-many-instance-attributes)
(Bitbake rev: 0c419902e5f58dcee9b7fbe9af1928da37e18399)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index bc108010bf..93a85ac7a9 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
@@ -34,38 +34,31 @@ class ViewTests(TestCase): | |||
34 | """Tests to verify view APIs.""" | 34 | """Tests to verify view APIs.""" |
35 | 35 | ||
36 | def setUp(self): | 36 | def setUp(self): |
37 | self.bbv = BitbakeVersion.objects.create(\ | 37 | bbv = BitbakeVersion.objects.create(name="test bbv", giturl="/tmp/", |
38 | name="test bbv", giturl="/tmp/", | 38 | branch="master", dirpath="") |
39 | branch="master", dirpath="") | 39 | release = Release.objects.create(name="test release", |
40 | self.release = Release.objects.create(\ | 40 | bitbake_version=bbv) |
41 | name="test release", bitbake_version=self.bbv) | ||
42 | self.project = Project.objects.create_project(name=PROJECT_NAME, | 41 | self.project = Project.objects.create_project(name=PROJECT_NAME, |
43 | release=self.release) | 42 | release=release) |
44 | self.layersrc = LayerSource.objects.create(\ | 43 | layersrc = LayerSource.objects.create(sourcetype=LayerSource.TYPE_IMPORTED) |
45 | sourcetype=LayerSource.TYPE_IMPORTED) | 44 | self.priority = ReleaseLayerSourcePriority.objects.create(release=release, |
46 | self.priority = ReleaseLayerSourcePriority.objects.create(\ | 45 | layer_source=layersrc) |
47 | release=self.release, | 46 | layer = Layer.objects.create(name="base-layer", layer_source=layersrc, |
48 | layer_source=self.layersrc) | 47 | vcs_url="/tmp/") |
49 | self.layer = Layer.objects.create(\ | 48 | |
50 | name="base-layer", | 49 | lver = Layer_Version.objects.create(layer=layer, project=self.project, |
51 | layer_source=self.layersrc, vcs_url="/tmp/") | 50 | layer_source=layersrc, commit="master") |
52 | self.lver = Layer_Version.objects.create(\ | 51 | |
53 | layer=self.layer, project=self.project, | 52 | Recipe.objects.create(layer_source=layersrc, name="base-recipe", |
54 | layer_source=self.layersrc, commit="master") | 53 | version="1.2", summary="one recipe", |
55 | 54 | description="recipe", layer_version=lver) | |
56 | self.recipe = Recipe.objects.create(\ | 55 | |
57 | layer_source=self.layersrc, name="base-recipe", | 56 | Machine.objects.create(layer_version=lver, name="wisk", |
58 | version="1.2", summary="one recipe", | 57 | description="wisking machine") |
59 | description="recipe", layer_version=self.lver) | 58 | |
60 | 59 | ProjectLayer.objects.create(project=self.project, layercommit=lver) | |
61 | self.machine = Machine.objects.create(\ | 60 | |
62 | layer_version=self.lver, name="wisk", | 61 | self.assertTrue(lver in self.project.compatible_layerversions()) |
63 | description="wisking machine") | ||
64 | |||
65 | ProjectLayer.objects.create(project=self.project, | ||
66 | layercommit=self.lver) | ||
67 | |||
68 | self.assertTrue(self.lver in self.project.compatible_layerversions()) | ||
69 | 62 | ||
70 | def test_get_base_call_returns_html(self): | 63 | def test_get_base_call_returns_html(self): |
71 | """Basic test for all-projects view""" | 64 | """Basic test for all-projects view""" |