test project base
This commit is contained in:
parent
c99518bcc8
commit
5ee4f41a87
2 changed files with 20 additions and 3 deletions
|
@ -10,6 +10,8 @@ import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
from wakatime.compat import u
|
from wakatime.compat import u
|
||||||
|
from wakatime.exceptions import NotYetImplemented
|
||||||
|
from wakatime.projects.base import BaseProject
|
||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +25,19 @@ class LanguagesTestCase(utils.TestCase):
|
||||||
['wakatime.session_cache.SessionCache.get', requests.session],
|
['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):
|
def test_project_argument_overrides_detected_project(self):
|
||||||
response = Response()
|
response = Response()
|
||||||
response.status_code = 0
|
response.status_code = 0
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from ..exceptions import NotYetImplemented
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger('WakaTime')
|
log = logging.getLogger('WakaTime')
|
||||||
|
|
||||||
|
@ -30,14 +32,14 @@ class BaseProject(object):
|
||||||
returns True if project is valid, otherwise
|
returns True if project is valid, otherwise
|
||||||
returns False.
|
returns False.
|
||||||
"""
|
"""
|
||||||
return False # pragma: nocover
|
raise NotYetImplemented()
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
""" Returns the project's name.
|
""" Returns the project's name.
|
||||||
"""
|
"""
|
||||||
return None
|
raise NotYetImplemented()
|
||||||
|
|
||||||
def branch(self):
|
def branch(self):
|
||||||
""" Returns the current branch.
|
""" Returns the current branch.
|
||||||
"""
|
"""
|
||||||
return None # pragma: nocover
|
raise NotYetImplemented()
|
||||||
|
|
Loading…
Reference in a new issue