diff options
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/tests.py')
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/tests.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/tests.py b/bitbake/lib/toaster/bldcontrol/tests.py index 37d6524c36..5a9d1df37a 100644 --- a/bitbake/lib/toaster/bldcontrol/tests.py +++ b/bitbake/lib/toaster/bldcontrol/tests.py | |||
| @@ -141,3 +141,22 @@ class RunBuildsCommandTests(TestCase): | |||
| 141 | self.assertTrue(br.state == BuildRequest.REQ_INPROGRESS, "Request is not updated") | 141 | self.assertTrue(br.state == BuildRequest.REQ_INPROGRESS, "Request is not updated") |
| 142 | # no more selections possible here | 142 | # no more selections possible here |
| 143 | self.assertRaises(IndexError, command._selectBuildRequest) | 143 | self.assertRaises(IndexError, command._selectBuildRequest) |
| 144 | |||
| 145 | |||
| 146 | class UtilityTests(TestCase): | ||
| 147 | def test_reduce_path(self): | ||
| 148 | from bldcontrol.management.commands.loadconf import _reduce_canon_path, _get_id_for_sourcetype | ||
| 149 | |||
| 150 | self.assertTrue( _reduce_canon_path("/") == "/") | ||
| 151 | self.assertTrue( _reduce_canon_path("/home/..") == "/") | ||
| 152 | self.assertTrue( _reduce_canon_path("/home/../ana") == "/ana") | ||
| 153 | self.assertTrue( _reduce_canon_path("/home/../ana/..") == "/") | ||
| 154 | self.assertTrue( _reduce_canon_path("/home/ana/mihai/../maria") == "/home/ana/maria") | ||
| 155 | |||
| 156 | def test_get_id_for_sorucetype(self): | ||
| 157 | from bldcontrol.management.commands.loadconf import _reduce_canon_path, _get_id_for_sourcetype | ||
| 158 | self.assertTrue( _get_id_for_sourcetype("layerindex") == 1) | ||
| 159 | self.assertTrue( _get_id_for_sourcetype("local") == 0) | ||
| 160 | self.assertTrue( _get_id_for_sourcetype("imported") == 2) | ||
| 161 | with self.assertRaises(Exception): | ||
| 162 | _get_id_for_sourcetype("unknown") | ||
