add ruff. fix all linting
This commit is contained in:
@@ -20,22 +20,19 @@ from chromy.command_inputs import (
|
||||
|
||||
class BuildCommandInputTests(unittest.TestCase):
|
||||
def test_parser_converts_list_collections_and_alias(self) -> None:
|
||||
self.assertEqual(_parse_input(
|
||||
["list-collections"]), ListCollectionsInput())
|
||||
self.assertEqual(_parse_input(["list-collections"]), ListCollectionsInput())
|
||||
self.assertEqual(_parse_input(["lc"]), ListCollectionsInput())
|
||||
|
||||
def test_parser_converts_create_collection_and_alias(self) -> None:
|
||||
expected = CreateCollectionInput(collection="notes")
|
||||
|
||||
self.assertEqual(_parse_input(
|
||||
["create-collection", "notes"]), expected)
|
||||
self.assertEqual(_parse_input(["create-collection", "notes"]), expected)
|
||||
self.assertEqual(_parse_input(["cc", "notes"]), expected)
|
||||
|
||||
def test_parser_converts_delete_collection_and_alias(self) -> None:
|
||||
expected = DeleteCollectionInput(collection="notes")
|
||||
|
||||
self.assertEqual(_parse_input(
|
||||
["delete-collection", "notes"]), expected)
|
||||
self.assertEqual(_parse_input(["delete-collection", "notes"]), expected)
|
||||
self.assertEqual(_parse_input(["dc", "notes"]), expected)
|
||||
|
||||
def test_parser_converts_count_and_alias(self) -> None:
|
||||
@@ -45,8 +42,7 @@ class BuildCommandInputTests(unittest.TestCase):
|
||||
self.assertEqual(_parse_input(["co", "notes"]), expected)
|
||||
|
||||
def test_parser_converts_add_data_and_alias(self) -> None:
|
||||
expected = AddDataInput(
|
||||
collection="notes", file="romeo_and_juliet.txt")
|
||||
expected = AddDataInput(collection="notes", file="romeo_and_juliet.txt")
|
||||
|
||||
self.assertEqual(
|
||||
_parse_input(["add-data", "notes", "romeo_and_juliet.txt"]),
|
||||
@@ -64,12 +60,10 @@ class BuildCommandInputTests(unittest.TestCase):
|
||||
_parse_input(["query", "notes", "Where is Romeo?"]),
|
||||
expected,
|
||||
)
|
||||
self.assertEqual(_parse_input(
|
||||
["q", "notes", "Where is Romeo?"]), expected)
|
||||
self.assertEqual(_parse_input(["q", "notes", "Where is Romeo?"]), expected)
|
||||
|
||||
def test_parser_converts_delete_records_and_alias(self) -> None:
|
||||
expected = DeleteRecordsInput(
|
||||
collection="notes", where="file_name=play.txt")
|
||||
expected = DeleteRecordsInput(collection="notes", where="file_name=play.txt")
|
||||
|
||||
self.assertEqual(
|
||||
_parse_input(["delete", "notes", "--where", "file_name=play.txt"]),
|
||||
@@ -81,8 +75,7 @@ class BuildCommandInputTests(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_invalid_delete_filter_keeps_user_facing_error(self) -> None:
|
||||
args = Namespace(command="delete", collection="notes",
|
||||
where="file_name")
|
||||
args = Namespace(command="delete", collection="notes", where="file_name")
|
||||
output = io.StringIO()
|
||||
|
||||
with redirect_stdout(output):
|
||||
|
||||
Reference in New Issue
Block a user