Skip to content

Commit

Permalink
Call constructor of SavedSearch directly in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
picsel2 committed Mar 8, 2024
1 parent ad44cf2 commit dfdedd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions GTG/core/saved_searches.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ def __init__(self, id: UUID, name: str, query: str) -> None:

super().__init__()

# TODO probably not needed
@classmethod
def create(cls, name: str, query: str) -> 'SavedSearch':
return cls(uuid4(), name, query)

@GObject.Property(type=str)
def name(self) -> str:
"""Read only property."""
Expand Down
8 changes: 4 additions & 4 deletions tests/core/test_saved_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def test_remove_simple(self):
def test_count(self):
store = SavedSearchStore()

search = store.add(SavedSearch.create('Root search', '@tag'))
store.add(SavedSearch.create('Root search 2', '@tag2'))
search = store.add(SavedSearch(uuid4(), 'Root search', '@tag'))
store.add(SavedSearch(uuid4(), 'Root search 2', '@tag2'))

self.assertEqual(store.count(), 2)
store.remove(search.id)
Expand Down Expand Up @@ -102,8 +102,8 @@ def test_xml_load_tree(self):
def test_xml_write_simple(self):

store = SavedSearchStore()
search1 = store.add(SavedSearch.create('Some @tag', 'Looking for some tag'))
search2 = store.add(SavedSearch.create('Some @other @tag', 'Looking for more'))
search1 = store.add(SavedSearch(uuid4(), 'Some @tag', 'Looking for some tag'))
search2 = store.add(SavedSearch(uuid4(), 'Some @other @tag', 'Looking for more'))

xml_root = store.to_xml()

Expand Down

0 comments on commit dfdedd3

Please sign in to comment.