Skip to content

Commit

Permalink
chore: fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Oct 15, 2024
1 parent c1d5ba9 commit 8576a2d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion alephclient/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import click
import logging
import sys
from pathlib import Path

from alephclient import settings
from alephclient.api import AlephAPI
Expand Down
4 changes: 1 addition & 3 deletions alephclient/crawldir.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import logging
import threading
import re
import stat
import os
from os import PathLike
from queue import Queue
from pathlib import Path, PurePath
from pathlib import Path
from typing import cast, Optional, Dict

from alephclient import settings
from alephclient.api import AlephAPI
from alephclient.errors import AlephException
from alephclient.util import backoff
Expand Down
1 change: 0 additions & 1 deletion alephclient/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import multiprocessing

# Aleph client API settings
HOST = os.environ.get("MEMORIOUS_ALEPH_HOST")
Expand Down
2 changes: 1 addition & 1 deletion alephclient/tests/test_api_collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from requests import Response
from alephclient.errors import AlephException
from alephclient.api import AlephAPI, APIResultSet
from alephclient.api import AlephAPI


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion alephclient/tests/test_api_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_search(self, mocker):
mocker.patch.object(self.api, "_request")
search_result = self.api.search(self.fake_query)

assert isinstance(search_result, APIResultSet) == True
assert isinstance(search_result, APIResultSet)

def test_search_url(self, mocker):
mocker.patch.object(self.api, "_request")
Expand Down
8 changes: 4 additions & 4 deletions alephclient/tests/test_crawldir.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_get_foreign_id_with_dir(self):
path = Path(os.path.join(self.base_path, "jan/week1"))
crawldir = CrawlDirectory(AlephAPI, {}, path)
foreign_id = crawldir.get_foreign_id(path)
assert foreign_id == None
assert foreign_id is None

def test_get_foreign_id_with_file(self):
path = Path(os.path.join(self.base_path, "feb/2.txt"))
Expand All @@ -33,18 +33,18 @@ def test_is_excluded(self):
path = Path(os.path.join(self.base_path, "jan/week1"))
crawldir = CrawlDirectory(AlephAPI, {}, path)
is_excluded = crawldir.is_excluded(path)
assert is_excluded == False
assert not is_excluded

def test_is_excluded_no_exclude(self):
path = Path(os.path.join(self.base_path, "jan/week1"))
crawldir = CrawlDirectory(AlephAPI, {}, path)
crawldir.exclude = None
is_excluded = crawldir.is_excluded(path)
assert is_excluded == False
assert not is_excluded

def test_is_excluded_exclude_dir(self):
path = Path(os.path.join(self.base_path, "jan/week1"))
crawldir = CrawlDirectory(AlephAPI, {}, path, nojunk=True)
crawldir.exclude["d"] = re.compile(r"week1\/*", re.I)
is_excluded = crawldir.is_excluded(path)
assert is_excluded == True
assert is_excluded

0 comments on commit 8576a2d

Please sign in to comment.