OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 import os |
| 4 import unittest |
| 5 from manifestparser import TestManifest |
| 6 |
| 7 here = os.path.dirname(os.path.abspath(__file__)) |
| 8 |
| 9 class TestTestManifest(unittest.TestCase): |
| 10 """Test the Test Manifest""" |
| 11 |
| 12 def test_testmanifest(self): |
| 13 # Test filtering based on platform: |
| 14 filter_example = os.path.join(here, 'filter-example.ini') |
| 15 manifest = TestManifest(manifests=(filter_example,)) |
| 16 self.assertEqual([i['name'] for i in manifest.active_tests(os='win', dis
abled=False, exists=False)], |
| 17 ['windowstest', 'fleem']) |
| 18 self.assertEqual([i['name'] for i in manifest.active_tests(os='linux', d
isabled=False, exists=False)], |
| 19 ['fleem', 'linuxtest']) |
| 20 |
| 21 # Look for existing tests. There is only one: |
| 22 self.assertEqual([i['name'] for i in manifest.active_tests()], |
| 23 ['fleem']) |
| 24 |
| 25 # You should be able to expect failures: |
| 26 last_test = manifest.active_tests(exists=False, toolkit='gtk2')[-1] |
| 27 self.assertEqual(last_test['name'], 'linuxtest') |
| 28 self.assertEqual(last_test['expected'], 'pass') |
| 29 last_test = manifest.active_tests(exists=False, toolkit='cocoa')[-1] |
| 30 self.assertEqual(last_test['expected'], 'fail') |
| 31 |
| 32 |
| 33 if __name__ == '__main__': |
| 34 unittest.main() |
OLD | NEW |