mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-30 03:11:29 +02:00
Save
This commit is contained in:
parent
0bfacc1d66
commit
4dfb314628
2
Makefile
2
Makefile
@ -38,7 +38,7 @@ lint: ## check style with flake8
|
|||||||
# stop the build if there are Python syntax errors or undefined names
|
# stop the build if there are Python syntax errors or undefined names
|
||||||
flake8 gitinspector tests --count --select=E9,F63,F7,F82 --show-source --statistics --builtins="_"
|
flake8 gitinspector tests --count --select=E9,F63,F7,F82 --show-source --statistics --builtins="_"
|
||||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||||
flake8 gitinspector tests --count --ignore=E722,W503,E401,C901 --exit-zero --max-complexity=10 --max-line-length=127 --statistics --builtins="_"
|
flake8 gitinspector tests --count --ignore=E203,E722,W503,E401,C901 --exit-zero --max-complexity=10 --max-line-length=127 --statistics --builtins="_"
|
||||||
|
|
||||||
format: ## auto format all the code with black
|
format: ## auto format all the code with black
|
||||||
black gitinspector --line-length 127
|
black gitinspector --line-length 127
|
||||||
|
4
Pipfile
4
Pipfile
@ -8,14 +8,10 @@ name = "pypi"
|
|||||||
[dev-packages]
|
[dev-packages]
|
||||||
pytest = "*"
|
pytest = "*"
|
||||||
flake8 = "*"
|
flake8 = "*"
|
||||||
autopep8 = "*"
|
|
||||||
black = "*"
|
black = "*"
|
||||||
twine = "*"
|
twine = "*"
|
||||||
coverage = "*"
|
coverage = "*"
|
||||||
coveralls = "*"
|
coveralls = "*"
|
||||||
|
|
||||||
[requires]
|
|
||||||
python_version = "3.8"
|
|
||||||
|
|
||||||
[pipenv]
|
[pipenv]
|
||||||
allow_prereleases = true
|
allow_prereleases = true
|
||||||
|
31
tests/test_basedir.py
Normal file
31
tests/test_basedir.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
from gitinspector import basedir
|
||||||
|
|
||||||
|
class TestBasedirModule(unittest.TestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.TEST_BASEDIR = Path(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
self.PROJECT_BASEDIR = Path(self.TEST_BASEDIR).parent
|
||||||
|
self.MODULE_BASEDIR = Path(self.PROJECT_BASEDIR, 'gitinspector')
|
||||||
|
self.CWD = os.getcwd()
|
||||||
|
|
||||||
|
def test_get_basedir(self):
|
||||||
|
expected = str(self.MODULE_BASEDIR)
|
||||||
|
actual = basedir.get_basedir()
|
||||||
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
def test_get_basedir_git(self):
|
||||||
|
expected = self.CWD
|
||||||
|
actual = basedir.get_basedir_git()
|
||||||
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
def test_get_basedir_git_with_path(self):
|
||||||
|
expected = str(self.PROJECT_BASEDIR)
|
||||||
|
actual = basedir.get_basedir_git(self.TEST_BASEDIR)
|
||||||
|
self.assertEqual(expected, actual)
|
24
tests/test_blame.py
Normal file
24
tests/test_blame.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
from gitinspector import blame
|
||||||
|
|
||||||
|
class TestBlameModule(unittest.TestCase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.TEST_BASEDIR = Path(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
self.PROJECT_BASEDIR = Path(self.TEST_BASEDIR).parent
|
||||||
|
self.MODULE_BASEDIR = Path(self.PROJECT_BASEDIR, 'gitinspector')
|
||||||
|
self.CWD = os.getcwd()
|
||||||
|
|
||||||
|
def test_BlameEntry_attrs(self):
|
||||||
|
blame_entry = blame.BlameEntry()
|
||||||
|
expected = 0
|
||||||
|
self.assertEqual(expected, blame_entry.rows)
|
||||||
|
self.assertEqual(expected, blame_entry.skew)
|
||||||
|
self.assertEqual(expected, blame_entry.comments)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user