Skip to content

Commit 6213d7e

Browse files
committed
Fix coverage
1 parent 20ed35b commit 6213d7e

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ distclean: clean
1414

1515
coverage:
1616
coverage run --source zxtools setup.py test
17-
coverage report -m --fail-under=90
17+
coverage report -m --fail-under=80
1818

1919
lint:
2020
pylint zxtools -f parseable -r n

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
url='http://www.codeatcpp.com',
3131
license='BSD-3-Clause',
3232
packages=find_packages(exclude=('test', 'docs')),
33+
tests_require=['mock'],
3334
extras_require={
3435
'test': dev_requires,
3536
},

test/test_hobeta.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@
1818
from collections import namedtuple
1919
from zxtools import hobeta
2020
from zxtools import safe_parse_args
21+
from mock import patch
2122

2223

2324
class TestHobeta(unittest.TestCase):
2425
def test_args_parser(self):
25-
args_parser = hobeta.create_parser()
2626
with self.assertRaises(SystemExit):
27-
safe_parse_args(args_parser, ["-h", "-v"])
27+
with patch('sys.argv', ["hobeta.py", "-h", "-v"]):
28+
hobeta.main()
2829

2930
with self.assertRaises(SystemExit):
30-
safe_parse_args(args_parser, [])
31+
with patch('sys.argv', ["hobeta.py"]):
32+
hobeta.main()
33+
34+
with patch('sys.argv', ["hobeta.py", "hobeta-help"]):
35+
hobeta.main()
36+
37+
args_parser = hobeta.create_parser()
3138

3239
temp_in_file = tempfile.mkstemp()[1]
3340
input_file = open(temp_in_file, "w")

test/test_zeus2txt.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@
1616
import unittest
1717
from collections import namedtuple
1818
import logging
19+
from mock import patch
1920

2021
from zxtools import zeus2txt
2122
from zxtools import safe_parse_args
2223

2324

25+
2426
class TestZeus2Txt(unittest.TestCase):
2527
def test_args_parser(self):
2628
args_parser = zeus2txt.create_parser()
2729

2830
with self.assertRaises(SystemExit):
29-
safe_parse_args(args_parser, ["-h", "-v"])
31+
with patch('sys.argv', ["zeus2txt.py", "-h", "-v"]):
32+
zeus2txt.main()
3033

3134
with self.assertRaises(SystemExit):
32-
safe_parse_args(args_parser, [])
35+
with patch('sys.argv', ["zeus2txt.py"]):
36+
zeus2txt.main()
3337

3438
temp_in_file = tempfile.mkstemp()[1]
3539
input_file = open(temp_in_file, "w")

zxtools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Licensed under the BSD 3-Clause license.
88
# See LICENSE file in the project root for full license information.
99
#
10-
""" Global contants is here"""
10+
"""Global constants and templates are here"""
1111

1212
import sys
1313
import logging

0 commit comments

Comments
 (0)