Remove unused imports, `embeddings' variable from text search tests

This commit is contained in:
Debanjum Singh Solanky
2022-09-16 00:06:21 +03:00
parent 7e9298f315
commit 2c548133f3
4 changed files with 6 additions and 17 deletions

View File

@@ -3,9 +3,6 @@ import re
from datetime import datetime
from math import inf
# External Packages
import torch
# Application Packages
from src.search_filter.date_filter import DateFilter
from src.utils.rawconfig import Entry

View File

@@ -1,6 +1,3 @@
# External Packages
import torch
# Application Packages
from src.search_filter.file_filter import FileFilter
from src.utils.rawconfig import Entry
@@ -9,7 +6,7 @@ from src.utils.rawconfig import Entry
def test_no_file_filter():
# Arrange
file_filter = FileFilter()
embeddings, entries = arrange_content()
entries = arrange_content()
q_with_no_filter = 'head tail'
# Act
@@ -25,7 +22,7 @@ def test_no_file_filter():
def test_file_filter_with_non_existent_file():
# Arrange
file_filter = FileFilter()
embeddings, entries = arrange_content()
entries = arrange_content()
q_with_no_filter = 'head file:"nonexistent.org" tail'
# Act
@@ -41,7 +38,7 @@ def test_file_filter_with_non_existent_file():
def test_single_file_filter():
# Arrange
file_filter = FileFilter()
embeddings, entries = arrange_content()
entries = arrange_content()
q_with_no_filter = 'head file:"file 1.org" tail'
# Act
@@ -57,7 +54,7 @@ def test_single_file_filter():
def test_file_filter_with_partial_match():
# Arrange
file_filter = FileFilter()
embeddings, entries = arrange_content()
entries = arrange_content()
q_with_no_filter = 'head file:"1.org" tail'
# Act
@@ -73,7 +70,7 @@ def test_file_filter_with_partial_match():
def test_file_filter_with_regex_match():
# Arrange
file_filter = FileFilter()
embeddings, entries = arrange_content()
entries = arrange_content()
q_with_no_filter = 'head file:"*.org" tail'
# Act
@@ -89,7 +86,7 @@ def test_file_filter_with_regex_match():
def test_multiple_file_filter():
# Arrange
file_filter = FileFilter()
embeddings, entries = arrange_content()
entries = arrange_content()
q_with_no_filter = 'head tail file:"file 1.org" file:"file2.org"'
# Act
@@ -103,7 +100,6 @@ def test_multiple_file_filter():
def arrange_content():
embeddings = torch.randn(4, 10)
entries = [
Entry(compiled='', raw='First Entry', file= 'file 1.org'),
Entry(compiled='', raw='Second Entry', file= 'file2.org'),

View File

@@ -2,9 +2,6 @@
from pathlib import Path
from PIL import Image
# External Packages
import pytest
# Internal Packages
from src.utils.state import model
from src.utils.constants import web_directory

View File

@@ -1,6 +1,5 @@
# Application Packages
from src.search_filter.word_filter import WordFilter
from src.utils.config import SearchType
from src.utils.rawconfig import Entry