-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcery refactored main branch #3
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,15 +10,15 @@ def validate_verse(value: Optional[str]) -> None: | |
|
||
references: List[bible.NormalizedReference] = bible.get_references(value) | ||
|
||
if len(references) == 0: | ||
if not references: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
raise ValidationError("Not a valid reference.") | ||
|
||
if len(references) > 1: | ||
raise ValidationError("Only single verse references allowed.") | ||
|
||
verse_ids: List[int] = bible.convert_references_to_verse_ids(references) | ||
|
||
if len(verse_ids) == 0: | ||
if not verse_ids: | ||
raise ValidationError("Not a valid reference.") | ||
|
||
if len(verse_ids) > 1: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ def test_objects(test_object_factory): | |
"Genesis 1:1-4", | ||
] | ||
|
||
for i in range(0, 10): | ||
for i in range(10): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
test_object = test_object_factory(f"test object {i + 1}") | ||
test_object.set_verses( | ||
bible.convert_references_to_verse_ids(bible.get_references(references[i])) | ||
|
@@ -74,7 +74,7 @@ def test_single_verse_objects(test_single_verse_object_factory): | |
"Genesis 1:4", | ||
] | ||
|
||
for i in range(0, 10): | ||
for i in range(10): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
test_single_verse_object = test_single_verse_object_factory( | ||
f"test object {i + 1}" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
ScriptureIndexedModel.set_verses
refactored with the following changes:list-comprehension
)