Skip to content

Commit

Permalink
Add the fill-up date method
Browse files Browse the repository at this point in the history
  • Loading branch information
dplocki committed Jan 16, 2024
1 parent f90fc2f commit 203befc
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions e2e/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,17 @@ def add_entry(
return self

def __fill_up_dates(self):
self.metadata = [
(
file_name,
title,
description,
datetime.datetime(
2014, 7, 10, 2, 43, 55, 230107, tzinfo=datetime.timezone.utc
)
if published_date == None
else published_date,
)
for file_name, title, description, published_date in self.metadata
]
result = []
previous = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(
days=random.randrange(3, 5)
)

while self.metadata:
metadatum = self.metadata.pop()
previous -= datetime.timedelta(days=random.randrange(2, 6))
result.append((metadatum[0], metadatum[1], metadatum[2], previous))

self.metadata = reversed(result)

def build(self):
self.__fill_up_dates()
Expand Down

0 comments on commit 203befc

Please sign in to comment.