Skip to content

Commit

Permalink
Merge pull request #21 from unmade/fix-coverage
Browse files Browse the repository at this point in the history
Fix coverage
  • Loading branch information
unmade authored Oct 29, 2020
2 parents f7b4a53 + 8b16f59 commit d82dffe
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
line_length=88
multi_line_output=3
include_trailing_comma=true
known_first_party=thriftpyi
default_section=THIRDPARTY
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ pre-commit = "^1.16"
mypy = "^0.701.0"
pylint = "^2.3"

[tool.isort]
line_length = 88
multi_line_output = 3
include_trailing_comma = true

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
1 change: 1 addition & 0 deletions src/thriftpyi/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import click

from thriftpyi.main import thriftpyi


Expand Down
1 change: 1 addition & 0 deletions src/thriftpyi/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import thriftpy2
from thriftpy2.thrift import TPayloadMeta

from thriftpyi.utils import get_python_type


Expand Down
1 change: 1 addition & 0 deletions src/thriftpyi/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from importlib import resources

from jinja2 import Template

from thriftpyi.entities import Content


Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pytest
from click.testing import CliRunner

from thriftpyi.cli import main


Expand Down
16 changes: 16 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from unittest import mock

from thriftpyi.utils import _get_binary as get_binary

# This should be redo with 'skipif' and different
# thriftpy2 versions (old one and the one with binary support)


def test_get_binary_returns_str():
with mock.patch("thriftpy2.thrift.TType.BINARY", 11):
assert get_binary([]) == "str"


def test_get_binary_returns_bytes():
with mock.patch("thriftpy2.thrift.TType.BINARY", 18):
assert get_binary([]) == "bytes"

0 comments on commit d82dffe

Please sign in to comment.