Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Apr 16, 2020
1 parent 68e4964 commit d25b619
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyannotate_tools/fixes/tests/test_annotate_json_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import tempfile
import unittest
import sys
from mock import patch

from lib2to3.tests.test_fixers import FixerTestCase

Expand Down Expand Up @@ -632,3 +633,10 @@ async def foo(x: str) -> int:
return 42
"""
self.check(a, b)

@patch('pyannotate_tools.fixes.fix_annotate_json.FixAnnotateJson.set_filename')
def test_set_filename(self, mocked_set_filename):
self.setTestData(
[{"path": "/path/to/file.py"}])
self.unchanged("")
mocked_set_filename.assert_called_with("/path/to/file.py")
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mock>=3.0
mypy_extensions>=0.3.0
pytest>=3.3.0
setuptools>=28.8.0
Expand Down

0 comments on commit d25b619

Please sign in to comment.