We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Steps to reproduce the behavior:
structure
-- main ---- base.py -- test ---- test.py
base.py:
from abc import abstractmethod, ABC class BaseTokenizer(ABC): @abstractmethod def tokenize(self, text): return def itokenize(self, text, *args, **kwargs): return (t for t in self.tokenize(text, *args, **kwargs)) class WordTokenizer(BaseTokenizer): def tokenize(self, text, include_punc=True): return [] class BaseBlob(object): tokenizer = WordTokenizer() def __init__(self, text): self.raw = self.string = text def tokens(self): return list(self.tokenizer.tokenize(self.raw)) class TextBlob(BaseBlob): pass
test.py:
from unittest import TestCase, main from main import base as tb from main.base import WordTokenizer class TextBlobTest(TestCase): def setUp(self): self.text = 'Explicit is better than implicit.' self.blob = tb.TextBlob(self.text) def test_tokens_property(self): self.assertTrue(self.blob.tokens, list(WordTokenizer().tokenize(self.text)))
Apply the Rename Method refactoring with the new name 'continuous' to the method 'BaseTokenizer.tokenize'
Expected code after refactoring:
structure:
from abc import abstractmethod, ABC class BaseTokenizer(ABC): @abstractmethod def CONTINUOUS(self, text): return def itokenize(self, text, *args, **kwargs): return (t for t in self.CONTINUOUS(text, *args, **kwargs)) class WordTokenizer(BaseTokenizer): def CONTINUOUS(self, text, include_punc=True): return [] class BaseBlob(object): tokenizer = WordTokenizer() def __init__(self, text): self.raw = self.string = text def tokens(self): return list(self.tokenizer.CONTINUOUS(self.raw)) class TextBlob(BaseBlob): pass
from unittest import TestCase, main from main import base as tb from main.base import WordTokenizer class TextBlobTest(TestCase): def setUp(self): self.text = 'Explicit is better than implicit.' self.blob = tb.TextBlob(self.text) def test_tokens_property(self): self.assertTrue(self.blob.tokens, list(WordTokenizer().CONTINUOUS(self.text)))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps to reproduce the behavior:
structure
base.py:
test.py:
Apply the Rename Method refactoring with the new name 'continuous' to the method 'BaseTokenizer.tokenize'
Expected code after refactoring:
structure:
base.py:
test.py:
The text was updated successfully, but these errors were encountered: