From cdb1f4175fb70812ed2c4cd3677ce84b66675f44 Mon Sep 17 00:00:00 2001 From: myslak71 <43068450+myslak71@users.noreply.github.com> Date: Fri, 2 Aug 2019 19:00:54 +0200 Subject: [PATCH] v.0.1.0 --- README.md | 2 +- flake8_koles/__about__.py | 4 ++-- tests/test_checker.py | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d938221..495c6ad 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](https://travis-ci.org/myslak71/flake8-koles.svg?branch=master)](https://travis-ci.org/myslak71/flake8-koles) [![Coverage Status](https://coveralls.io/repos/github/myslak71/flake8-koles/badge.svg?branch=master)](https://coveralls.io/github/myslak71/flake8-koles?branch=master) ![image](https://img.shields.io/badge/python-3.7-blue.svg) -![image](https://img.shields.io/badge/version-0.0.1-yellow) +![image](https://img.shields.io/badge/version-0.1.0-yellow) Watch your language young pal! diff --git a/flake8_koles/__about__.py b/flake8_koles/__about__.py index 4eb3a23..2cbe232 100644 --- a/flake8_koles/__about__.py +++ b/flake8_koles/__about__.py @@ -2,11 +2,11 @@ __title__ = 'flake8-koles' __description__ = 'Watch your language young lad! Swears nad curses linter.' -__version__ = 'v0.0.1' +__version__ = 'v0.1.0' __author__ = 'myslak71' __author_email__ = 'myslak@protonmail.com' __url__ = 'https://github.com/myslak71/flake8-koles' __license__ = 'MIT' __copyright__ = 'Copyright 2019 myslak71' __keywords__ = ['linter', 'flake8', 'swears', 'curses'] -__download_url__ = 'https://github.com/myslak71/flake8-koles/archive/v0.0.1.tar.gz' +__download_url__ = 'https://github.com/myslak71/flake8-koles/archive/v0.1.0.tar.gz' diff --git a/tests/test_checker.py b/tests/test_checker.py index af8b175..f4bc9b5 100644 --- a/tests/test_checker.py +++ b/tests/test_checker.py @@ -3,6 +3,7 @@ from unittest.mock import Mock import pytest +from flake8.options.manager import OptionManager, Option from flake8_koles.checker import KolesChecker @@ -221,3 +222,26 @@ def test_run( (1, 5, 'KOL001 Bad language found: v***', KolesChecker), (3, 4, 'KOL001 Bad language found: b**', KolesChecker), (3, 8, 'KOL001 Bad language found: w****', KolesChecker)] + + +def test_add_options(koles_checker): + """Test that all options are added to the parser.""" + option_manager = OptionManager() + koles_checker.add_options(option_manager) + + assert repr(option_manager.options) == repr([ + Option( + long_option_name="--ignore-shorties", default=0, type="int", parse_from_config=True + ), + Option( + long_option_name="--censor-msg", default=0, parse_from_config=True, action='store_true' + ) + ]) + + +def test_parse_options(koles_checker): + """Test that options are correctly assigned to the class.""" + test_options = {'kick_it': True} + koles_checker.parse_options(test_options) + + assert koles_checker.options == test_options