From 5ee4f41a878268e82f4f6e45cfab69d101fdda52 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Sat, 26 Sep 2015 19:23:38 -0700 Subject: [PATCH] test project base --- tests/test_project.py | 15 +++++++++++++++ wakatime/projects/base.py | 8 +++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/test_project.py b/tests/test_project.py index 82d86e1..25b3533 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -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 diff --git a/wakatime/projects/base.py b/wakatime/projects/base.py index 882b035..4269d39 100644 --- a/wakatime/projects/base.py +++ b/wakatime/projects/base.py @@ -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()