test project base

This commit is contained in:
Alan Hamlett 2015-09-26 19:23:38 -07:00
parent c99518bcc8
commit 5ee4f41a87
2 changed files with 20 additions and 3 deletions

View file

@ -10,6 +10,8 @@ import shutil
import tempfile
import time
from wakatime.compat import u
from wakatime.exceptions import NotYetImplemented
from wakatime.projects.base import BaseProject
from . import utils
@ -23,6 +25,19 @@ class LanguagesTestCase(utils.TestCase):
['wakatime.session_cache.SessionCache.get', requests.session],
]
def test_project_base(self):
path = 'tests/samples/codefiles/see.h'
project = BaseProject(path)
with self.assertRaises(NotYetImplemented):
project.process()
with self.assertRaises(NotYetImplemented):
project.name()
with self.assertRaises(NotYetImplemented):
project.branch()
def test_project_argument_overrides_detected_project(self):
response = Response()
response.status_code = 0

View file

@ -11,6 +11,8 @@
import logging
from ..exceptions import NotYetImplemented
log = logging.getLogger('WakaTime')
@ -30,14 +32,14 @@ class BaseProject(object):
returns True if project is valid, otherwise
returns False.
"""
return False # pragma: nocover
raise NotYetImplemented()
def name(self):
""" Returns the project's name.
"""
return None
raise NotYetImplemented()
def branch(self):
""" Returns the current branch.
"""
return None # pragma: nocover
raise NotYetImplemented()