correctly test output when timeout value is not integer

This commit is contained in:
Alan Hamlett 2015-09-29 22:39:06 -07:00
parent 75aa9a2994
commit d953c13203
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
Traceback (most recent call last):
File "{file}", line 228, in parseArguments
args.timeout = int(configs.get('settings', 'timeout'))
ValueError: invalid literal for int() with base 10: 'abc'

View file

@ -108,7 +108,9 @@ class BaseTestCase(utils.TestCase):
args = ['--file', entity, '--config', config] args = ['--file', entity, '--config', config]
retval = execute(args) retval = execute(args)
self.assertEquals(retval, 0) self.assertEquals(retval, 0)
self.assertEquals(sys.stdout.getvalue(), '') expected_stdout = open('tests/samples/output/main_test_good_config_file').read()
traceback_file = os.path.realpath('wakatime/main.py')
self.assertEquals(sys.stdout.getvalue(), expected_stdout.format(file=traceback_file))
self.assertEquals(sys.stderr.getvalue(), '') self.assertEquals(sys.stderr.getvalue(), '')
self.patched['wakatime.session_cache.SessionCache.get'].assert_called_once_with() self.patched['wakatime.session_cache.SessionCache.get'].assert_called_once_with()