Skip to content

Commit 3098840

Browse files
committed
parser: Add coverage & missing files
1 parent c90fad4 commit 3098840

File tree

6 files changed

+67
-3
lines changed

6 files changed

+67
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__/
55
parser/snooty.py
66
*.dist/
77
node_modules/
8+
.coverage

parser/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lint:
99
pipenv run flake8 --max-line-length=100 snooty
1010

1111
test: lint
12-
pipenv run pytest
12+
pipenv run pytest --cov=snooty
1313

1414
nuitka:
1515
echo 'from snooty import main; main.main()' > snooty.py

parser/Pipfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
pymongo = {extras = ["snappy", "srv", "tls"], version = "*"}
7+
pymongo = {extras = ["snappy", "srv", "tls"],version = "*"}
88
docutils = "*"
99
dnspython = "*"
1010
watchdog = "*"
@@ -17,3 +17,4 @@ python-jsonrpc-server = "*"
1717
"flake8" = "*"
1818
mypy = "*"
1919
pytest = "*"
20+
pytest-cov = "*"

parser/Pipfile.lock

Lines changed: 45 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from pathlib import Path
2+
from .types import ProjectConfig
3+
4+
5+
def test_project() -> None:
6+
root_path, project_config, project_diagnostics = ProjectConfig.open(Path('test_data'))
7+
assert len(project_diagnostics) == 1
8+
assert project_config.constants == {
9+
'version': '3.4',
10+
'package_title': '3.4.tar.gz',
11+
'invalid': ''
12+
}

parser/test_data/snooty.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name = "test_data"
2+
3+
[constants]
4+
version = 3.4
5+
package_title = "{+version+}.tar.gz"
6+
invalid = "{+foo+}"

0 commit comments

Comments
 (0)