Skip to content

Commit

Permalink
v.0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
myslak71 committed Aug 2, 2019
1 parent 3101c7a commit 22acf46
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
2 changes: 1 addition & 1 deletion flake8_koles/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__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'
Expand Down
24 changes: 24 additions & 0 deletions tests/test_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from unittest.mock import Mock

import pytest
from flake8.options.manager import OptionManager, Option

from flake8_koles.checker import KolesChecker

Expand Down Expand Up @@ -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

0 comments on commit 22acf46

Please sign in to comment.