Skip to content

Commit

Permalink
Add 4 test bears
Browse files Browse the repository at this point in the history
These bears have all kinds of settings and the pairs are dependent
on the other. One pair has `@deprecate_settings` decorator applied
to the `run()` method.
  • Loading branch information
ishanSrt authored and gitmate-bot committed Jun 10, 2018
1 parent f507765 commit d3f96ee
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_bears/AllKindsOfSettingsBaseBear.py
@@ -0,0 +1,10 @@
from coalib.bears.LocalBear import LocalBear


class AllKindsOfSettingsBaseBear(LocalBear):

def run(self, file, filename, config, use_bear: bool,
max_line_lengths, no_line: int, use_space: bool = None,
use_tab: bool = False, max_line_length: int = 1000,
no_char=79, dependency_result=dict()):
pass
12 changes: 12 additions & 0 deletions tests/test_bears/AllKindsOfSettingsBaseDecoratedBear.py
@@ -0,0 +1,12 @@
from coalib.bears.LocalBear import LocalBear
from coalib.bearlib import deprecate_settings


class AllKindsOfSettingsBaseDecoratedBear(LocalBear):

@deprecate_settings(max_line_lengths='tab_width')
def run(self, file, filename, config, use_bear: bool,
max_line_lengths, no_line: int, use_space: bool = None,
use_tab: bool = False, max_line_length: int = 1000,
no_char=79, dependency_result=dict()):
pass
13 changes: 13 additions & 0 deletions tests/test_bears/AllKindsOfSettingsDependentBear.py
@@ -0,0 +1,13 @@
from coalib.bears.LocalBear import LocalBear
from tests.test_bears.AllKindsOfSettingsBaseBear import \
AllKindsOfSettingsBaseBear


class AllKindsOfSettingsDependentBear(LocalBear):
BEAR_DEPS = {AllKindsOfSettingsBaseBear}

def run(self, file, filename, configs, use_bears: bool,
no_lines: int, use_spaces: bool = None,
use_tabs: bool = False, max_line_lengths: int = 1000,
no_chars=79, chars=False, dependency_results=dict()):
pass
15 changes: 15 additions & 0 deletions tests/test_bears/AllKindsOfSettingsDependentDecoratedBear.py
@@ -0,0 +1,15 @@
from coalib.bears.LocalBear import LocalBear
from coalib.bearlib import deprecate_settings
from tests.test_bears.AllKindsOfSettingsBaseDecoratedBear import \
AllKindsOfSettingsBaseDecoratedBear


class AllKindsOfSettingsDependentDecoratedBear(LocalBear):
BEAR_DEPS = {AllKindsOfSettingsBaseDecoratedBear}

@deprecate_settings(max_line_lengths='tab_width')
def run(self, file, filename, configs, use_bears: bool,
no_lines: int, use_spaces: bool = None,
use_tabs: bool = False, max_line_lengths: int = 1000,
no_chars=79, chars=False, dependency_results=dict()):
pass

0 comments on commit d3f96ee

Please sign in to comment.