Remove periods from one-sentence comments
This commit is contained in:
parent
454c2898a0
commit
049a5f6f62
4 changed files with 308 additions and 308 deletions
|
|
@ -26,12 +26,12 @@ class AddressFactory(alchemy.SQLAlchemyModelFactory):
|
|||
# completeness sake, that is ok to do.
|
||||
primary_id = factory.LazyAttribute(lambda obj: obj.id)
|
||||
|
||||
# Mimic a Google Maps Place ID with just random characters.
|
||||
# Mimic a Google Maps Place ID with just random characters
|
||||
place_id = factory.LazyFunction(
|
||||
lambda: "".join(random.choice(string.ascii_lowercase) for _ in range(20)),
|
||||
)
|
||||
|
||||
# Place the addresses somewhere in downtown Paris.
|
||||
# Place the addresses somewhere in downtown Paris
|
||||
latitude = factory.Faker("pyfloat", min_value=48.845, max_value=48.865)
|
||||
longitude = factory.Faker("pyfloat", min_value=2.31, max_value=2.37)
|
||||
# city -> set by the `make_address` fixture as there is only one `city`
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
|
|||
"""
|
||||
|
||||
# Timestamps after `cancelled_at` are discarded
|
||||
# by the `post_generation` hook at the end of the `OrderFactory`.
|
||||
# by the `post_generation` hook at the end of the `OrderFactory`
|
||||
cancel_ = factory.Trait( # -> leading underscore does not work
|
||||
cancelled=True,
|
||||
cancelled_at_corrected=False,
|
||||
|
|
@ -83,7 +83,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
|
|||
ad_hoc = True
|
||||
scheduled_delivery_at = None
|
||||
scheduled_delivery_at_corrected = None
|
||||
# Without statistical info, we assume an ad-hoc `Order` delivered after 45 minutes.
|
||||
# Without statistical info, we assume an ad-hoc `Order` delivered after 45 minutes
|
||||
first_estimated_delivery_at = factory.LazyAttribute(
|
||||
lambda obj: obj.placed_at + dt.timedelta(minutes=45),
|
||||
)
|
||||
|
|
@ -118,7 +118,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
|
|||
restaurant_confirmed_at_corrected = factory.LazyAttribute(
|
||||
lambda obj: False if obj.restaurant_confirmed_at else None,
|
||||
)
|
||||
# Use the database defaults of the historic data.
|
||||
# Use the database defaults of the historic data
|
||||
estimated_prep_duration = 900
|
||||
estimated_prep_duration_corrected = False
|
||||
estimated_prep_buffer = 480
|
||||
|
|
@ -150,7 +150,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
|
|||
courier_accepted_at_corrected = factory.LazyAttribute(
|
||||
lambda obj: False if obj.courier_accepted_at else None,
|
||||
)
|
||||
# Sample a realistic utilization.
|
||||
# Sample a realistic utilization
|
||||
utilization = factory.LazyFunction(lambda: random.choice([50, 60, 70, 80, 90, 100]))
|
||||
|
||||
# Pickup-related attributes
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ class ScheduledOrderFactory(ad_hoc.AdHocOrderFactory):
|
|||
and calculated backwards from `.scheduled_delivery_at`.
|
||||
"""
|
||||
|
||||
# Attributes regarding the specialization of an `Order`: ad-hoc or scheduled.
|
||||
# Attributes regarding the specialization of an `Order`: ad-hoc or scheduled
|
||||
placed_at = factory.LazyFunction(utils.early_in_the_morning)
|
||||
ad_hoc = False
|
||||
# Discrete `datetime` objects in the "core" lunch time are enough.
|
||||
# Discrete `datetime` objects in the "core" lunch time are enough
|
||||
scheduled_delivery_at = factory.LazyFunction(
|
||||
lambda: random.choice(
|
||||
[
|
||||
|
|
@ -38,7 +38,7 @@ class ScheduledOrderFactory(ad_hoc.AdHocOrderFactory):
|
|||
),
|
||||
)
|
||||
scheduled_delivery_at_corrected = False
|
||||
# Assume the `Order` is on time.
|
||||
# Assume the `Order` is on time
|
||||
first_estimated_delivery_at = factory.LazyAttribute(
|
||||
lambda obj: obj.scheduled_delivery_at,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from tests.db.fake_data import factories
|
|||
@pytest.fixture
|
||||
def make_address(city):
|
||||
"""Replaces `AddressFactory.build()`: Create an `Address` in the `city`."""
|
||||
# Reset the identifiers before every test.
|
||||
# Reset the identifiers before every test
|
||||
factories.AddressFactory.reset_sequence(1)
|
||||
|
||||
def func(**kwargs):
|
||||
|
|
@ -25,7 +25,7 @@ def make_address(city):
|
|||
@pytest.fixture
|
||||
def make_courier():
|
||||
"""Replaces `CourierFactory.build()`: Create a `Courier`."""
|
||||
# Reset the identifiers before every test.
|
||||
# Reset the identifiers before every test
|
||||
factories.CourierFactory.reset_sequence(1)
|
||||
|
||||
def func(**kwargs):
|
||||
|
|
@ -38,7 +38,7 @@ def make_courier():
|
|||
@pytest.fixture
|
||||
def make_customer():
|
||||
"""Replaces `CustomerFactory.build()`: Create a `Customer`."""
|
||||
# Reset the identifiers before every test.
|
||||
# Reset the identifiers before every test
|
||||
factories.CustomerFactory.reset_sequence(1)
|
||||
|
||||
def func(**kwargs):
|
||||
|
|
@ -51,7 +51,7 @@ def make_customer():
|
|||
@pytest.fixture
|
||||
def make_restaurant(make_address):
|
||||
"""Replaces `RestaurantFactory.build()`: Create a `Restaurant`."""
|
||||
# Reset the identifiers before every test.
|
||||
# Reset the identifiers before every test
|
||||
factories.RestaurantFactory.reset_sequence(1)
|
||||
|
||||
def func(address=None, **kwargs):
|
||||
|
|
@ -74,7 +74,7 @@ def make_restaurant(make_address):
|
|||
@pytest.fixture
|
||||
def make_order(make_address, make_courier, make_customer, make_restaurant):
|
||||
"""Replaces `OrderFactory.build()`: Create a `Order`."""
|
||||
# Reset the identifiers before every test.
|
||||
# Reset the identifiers before every test
|
||||
factories.AdHocOrderFactory.reset_sequence(1)
|
||||
|
||||
def func(*, scheduled=False, restaurant=None, courier=None, **kwargs):
|
||||
|
|
@ -119,7 +119,7 @@ def make_order(make_address, make_courier, make_customer, make_restaurant):
|
|||
@pytest.fixture
|
||||
def make_replay_order(make_order, simulation):
|
||||
"""Replaces `ReplayedOrderFactory.build()`: Create a `ReplayedOrder`."""
|
||||
# Reset the identifiers before every test.
|
||||
# Reset the identifiers before every test
|
||||
factories.ReplayedOrderFactory.reset_sequence(1)
|
||||
|
||||
def func(*, scheduled=False, order=None, **kwargs):
|
||||
|
|
|
|||
Loading…
Reference in a new issue