author | Pankaj Malhotra(:bitgeeky) <mozpankaj1994@gmail.com> |
Tue, 04 Nov 2014 04:16:00 +0100 | |
changeset 214060 | 370927f1465a65fe8b2a4aa6b9a911a689ebe293 |
parent 214059 | 27c0521e84741ce1fa68a21aad87dce9c5414625 |
child 214061 | 196228507e75012c242a82ce5afe5e60a2635c03 |
push id | 27771 |
push user | ryanvm@gmail.com |
push date | Wed, 05 Nov 2014 19:04:24 +0000 |
treeherder | mozilla-central@305b4fecce99 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jgriffin |
bugs | 1087682 |
milestone | 36.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
testing/mozbase/manifestparser/tests/test_testmanifest.py | file | annotate | diff | comparison | revisions |
--- a/testing/mozbase/manifestparser/tests/test_testmanifest.py +++ b/testing/mozbase/manifestparser/tests/test_testmanifest.py @@ -3,16 +3,17 @@ import os import shutil import tempfile import unittest from manifestparser import TestManifest, ParseError here = os.path.dirname(os.path.abspath(__file__)) + class TestTestManifest(unittest.TestCase): """Test the Test Manifest""" def test_testmanifest(self): # Test filtering based on platform: filter_example = os.path.join(here, 'filter-example.ini') manifest = TestManifest(manifests=(filter_example,), strict=False) self.assertEqual([i['name'] for i in manifest.active_tests(os='win', disabled=False, exists=False)], @@ -40,17 +41,16 @@ class TestTestManifest(unittest.TestCase missing_path = os.path.join(here, 'missing-path.ini') manifest = TestManifest(manifests=(missing_path,), strict=True) self.assertRaises(IOError, manifest.active_tests) self.assertRaises(IOError, manifest.copy, tempdir) self.assertRaises(IOError, manifest.update, tempdir) shutil.rmtree(tempdir) - def test_comments(self): """ ensure comments work, see https://bugzilla.mozilla.org/show_bug.cgi?id=813674 """ comment_example = os.path.join(here, 'comment-example.ini') manifest = TestManifest(manifests=(comment_example,)) self.assertEqual(len(manifest.tests), 8) @@ -98,10 +98,23 @@ class TestTestManifest(unittest.TestCase options=AttributeDict(options), **info)), 5) # test for illegal subsuite value manifest.tests[0]['subsuite'] = 'subsuite=bar,foo=="bar",type="nothing"' self.assertRaises(ParseError, manifest.active_tests, exists=False, options=AttributeDict(options), **info) + def test_none_and_empty_manifest(self): + """ + Test TestManifest for None and empty manifest, see + https://bugzilla.mozilla.org/show_bug.cgi?id=1087682 + """ + none_manifest = TestManifest(manifests=None, strict=False) + self.assertEqual(len(none_manifest.test_paths()), 0) + self.assertEqual(len(none_manifest.active_tests()), 0) + + empty_manifest = TestManifest(manifests=[], strict=False) + self.assertEqual(len(empty_manifest.test_paths()), 0) + self.assertEqual(len(empty_manifest.active_tests()), 0) + if __name__ == '__main__': unittest.main()