Skip to content

Commit

Permalink
Decrease MIN_RESOURCE_LENGTH down to 2 to be able to gossip languages
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed May 30, 2023
1 parent a9c7b31 commit a643e2b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from tribler.core.components.knowledge.db.knowledge_db import Operation, ResourceType

VALID_TAGS = [
'nl',
'tag',
'Tag',
'Тэг',
Expand All @@ -13,7 +14,7 @@

INVALID_TAGS = [
'',
'ta', # less than 3
't',
't' * 51, # more than 50
]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MIN_RESOURCE_LENGTH = 3
MIN_RESOURCE_LENGTH = 2
MAX_RESOURCE_LENGTH = 50
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

def test_extract_only_valid_tags():
# test that extract_only_valid_tags extracts only valid tags
assert set(extract_only_valid_tags('[valid-tag, in va li d]', rules=general_rules)) == {'valid-tag'}
assert set(extract_only_valid_tags('[valid-tag, i n v a l i d]', rules=general_rules)) == {'valid-tag'}
2 changes: 1 addition & 1 deletion src/tribler/gui/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def test_tags_dialog(window):
assert widget.content_table.add_tags_dialog.dialog_widget.error_text_label.isVisible()

QTest.keyClick(tags_input, "c")
assert tags_input.tags[-1].text == "aac"
assert tags_input.tags[-1].text == "ac"

# Test creating a new tag by clicking to the right of the right-most tag
QTest.mouseClick(tags_input, Qt.LeftButton, pos=tags_input.tags[-1].rect.topRight().toPoint() + QPoint(10, 0))
Expand Down

0 comments on commit a643e2b

Please sign in to comment.