tests for TokenParser

This commit is contained in:
Alan Hamlett 2015-09-26 12:10:05 -07:00
parent 41d3419a99
commit fc203d3991
3 changed files with 28 additions and 1 deletions

14
wakatime/exceptions.py Normal file
View file

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
"""
wakatime.exceptions
~~~~~~~~~~~~~~~~~~~
Custom exceptions.
:copyright: (c) 2015 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
class NotYetImplemented(Exception):
"""This method needs to be implemented."""

View file

@ -15,6 +15,7 @@ import sys
import traceback
from ..compat import u, open, import_module
from ..exceptions import NotYetImplemented
log = logging.getLogger('WakaTime')
@ -39,7 +40,7 @@ class TokenParser(object):
"""
if not tokens and not self.tokens:
self.tokens = self._extract_tokens()
raise Exception('Not yet implemented.')
raise NotYetImplemented()
def append(self, dep, truncate=False, separator=None, truncate_to=None,
strip_whitespace=True):