This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/tests/test_args.py
2017-06-08 10:53:30 +01:00

22 lines
649 B
Python

from tests import BaseTestCase
from md_pdf.args import parse_args
class ArgParserTestCase(BaseTestCase):
def test_allows_no_args(self):
args = parse_args([])
self.assertFalse(args.update_csl)
self.assertEqual(args.verbose, 0)
def test_adds_verbosity(self):
args = parse_args(['-v'])
self.assertEqual(args.verbose, 1)
def test_chains_verbosity(self):
for i in range(1, 10):
args = parse_args(['-' + ('v' * i)])
self.assertEqual(args.verbose, i)
def test_csl_update(self):
args = parse_args(['--update-csl'])
self.assertTrue(args.update_csl)