Changeset 10:3c5d9b2b69b8 in pyenvjasmine
- Timestamp:
- Apr 22, 2015, 1:12:54 PM (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pyenvjasmine/tests/test_runner.py
r0 r10 18 18 jstests = TestRunner() 19 19 output = jstests.run() 20 self.assertTrue('Failed: 0' in output) 21 self.assertTrue('Passed: 5' in output) 20 # output is the resulting stdout from a subprocess call, which is a 21 # bytes object, hence the b'' for the checks 22 self.assertTrue(b'Failed: 0' in output) 23 self.assertTrue(b'Passed: 5' in output) 22 24 23 25 def test_runner_params(self): … … 36 38 output = jstests.run(spec='tests/specs/test_demo.spec.js') 37 39 lines = output.splitlines() 38 self.assertTrue(lines[0].endswith('specs/test_demo.spec.js'), 40 # output is the resulting stdout from a subprocess call, which is a 41 # bytes object, hence the b'' in the endswith/startswith calls 42 self.assertTrue(lines[0].endswith(b'specs/test_demo.spec.js'), 39 43 "wrong output: %s" % str(output)) 40 self.assertTrue(lines[1].startswith( '[ Envjs/1.6 (Rhino;'),44 self.assertTrue(lines[1].startswith(b'[ Envjs/1.6 (Rhino;'), 41 45 "wrong output: %s" % str(output)) 42 self.assertTrue( 'Passed: 4' in lines)43 self.assertTrue( 'Failed: 0' in lines)44 self.assertTrue( 'Total : 4' in lines)46 self.assertTrue(b'Passed: 4' in lines) 47 self.assertTrue(b'Failed: 0' in lines) 48 self.assertTrue(b'Total : 4' in lines) 45 49 46 50 def test_write_browser_htmlfile_markup_is_correct(self): … … 62 66 actual = file.read() 63 67 self.assertEqual(expected, actual) 64 68 65 69 def test_runner_with_browser_configfile(self): 66 70 """ … … 102 106 """ 103 107 jstests = TestRunner() 104 print '--- output expected ---'105 108 output = jstests.run(capture_output=False) 106 print '--- end output expected ---'107 109 self.assertEqual(output, None) 108
Note:
See TracChangeset
for help on using the changeset viewer.