Skip to content

Commit

Permalink
Flake&Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Jan 31, 2022
1 parent d8244a2 commit 0b3b4e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
from types import SimpleNamespace
from unittest.mock import Mock, patch

from ipv8.test.base import TestBase

from pony import orm
from pony.orm import commit, db_session

from ipv8.test.base import TestBase
# pylint: disable=protected-access
from tribler_core.components.tag.community.tag_payload import TagOperation, TagOperationEnum
from tribler_core.components.tag.db.tag_db import (
PUBLIC_KEY_FOR_AUTO_GENERATED_TAGS,
SHOW_THRESHOLD,
TagDatabase,
)
from tribler_core.components.tag.db.tag_db import PUBLIC_KEY_FOR_AUTO_GENERATED_TAGS, SHOW_THRESHOLD, TagDatabase
from tribler_core.utilities.pony_utils import get_or_create


Expand Down Expand Up @@ -89,7 +86,7 @@ def test_constructor_create_tables_true(self, mocked_generate_mapping: Mock):
mocked_generate_mapping.assert_called_with(create_tables=True)

@patch.object(orm.Database, 'generate_mapping')
def test_constructor_create_tables_true(self, mocked_generate_mapping: Mock):
def test_constructor_create_tables_false(self, mocked_generate_mapping: Mock):
TagDatabase(':memory:', create_tables=False)
mocked_generate_mapping.assert_called_with(create_tables=False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, notifier: Notifier, db: TagDatabase, mds: MDS.MetadataStore,
callback=self.process_torrent_title)
@db_session
def start(self):
self.logger.info(f'Start')
self.logger.info('Start')

max_row_id = self.mds.get_max_rowid()
is_finished = self.get_last_processed_torrent_id() >= max_row_id
Expand Down Expand Up @@ -76,7 +76,7 @@ def query(_start, _end):

is_finished = end >= max_row_id
if is_finished:
self.logger.info(f'Finish batch processing, cancel process_batch task')
self.logger.info('Finish batch processing, cancel process_batch task')
self.cancel_pending_task(name=self.process_batch.__name__)
return processed

Expand Down

0 comments on commit 0b3b4e1

Please sign in to comment.