Skip to content

Commit 1737d9b

Browse files
committed
Fix import
1 parent 0ffb40c commit 1737d9b

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

genai/tests/integration/upload_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest.mock import patch, MagicMock
33
from fastapi.testclient import TestClient
44
from main import app
5-
from genai.service.auth_service import UserInfo, get_current_user
5+
from service.auth_service import UserInfo, get_current_user
66

77
client = TestClient(app)
88

recipe_pdfs/scripts/basic_recipes.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
99
from reportlab.lib.units import inch
1010

11+
1112
def create_recipe_pdf():
1213
"""Create a PDF with 25 basic recipes."""
13-
14+
1415
recipes = [
1516
{
1617
"title": "Scrambled Eggs",
@@ -138,49 +139,50 @@ def create_recipe_pdf():
138139
"instructions": "Cook chicken with seasoning. Sauté peppers and onions. Serve in tortillas."
139140
}
140141
]
141-
142+
142143
# Create PDF
143144
current_dir = os.path.dirname(os.path.abspath(__file__))
144145
parent_dir = os.path.dirname(current_dir)
145146
pdf_path = os.path.join(parent_dir, "basic_recipes.pdf")
146147
doc = SimpleDocTemplate(pdf_path, pagesize=letter)
147148
styles = getSampleStyleSheet()
148149
story = []
149-
150+
150151
# Title page
151152
title = Paragraph("Basic Recipes Collection", styles['Title'])
152153
story.append(title)
153154
story.append(Spacer(1, 0.5*inch))
154-
155+
155156
# Add recipes
156157
for i, recipe in enumerate(recipes, 1):
157158
# Recipe title
158159
recipe_title = Paragraph(f"{i}. {recipe['title']}", styles['Heading2'])
159160
story.append(recipe_title)
160161
story.append(Spacer(1, 0.1*inch))
161-
162+
162163
# Ingredients
163164
ingredients_title = Paragraph("Ingredients:", styles['Heading3'])
164165
story.append(ingredients_title)
165-
166+
166167
for ingredient in recipe['ingredients']:
167168
ingredient_text = Paragraph(f"• {ingredient}", styles['Normal'])
168169
story.append(ingredient_text)
169-
170+
170171
story.append(Spacer(1, 0.1*inch))
171-
172+
172173
# Instructions
173174
instructions_title = Paragraph("Instructions:", styles['Heading3'])
174175
story.append(instructions_title)
175-
176+
176177
instructions_text = Paragraph(recipe['instructions'], styles['Normal'])
177178
story.append(instructions_text)
178-
179+
179180
story.append(Spacer(1, 0.3*inch))
180-
181+
181182
# Build PDF
182183
doc.build(story)
183184
print("PDF created successfully")
184185

186+
185187
if __name__ == "__main__":
186-
create_recipe_pdf()
188+
create_recipe_pdf()

recipe_pdfs/scripts/basic_recipes2.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
99
from reportlab.lib.units import inch
1010

11+
1112
def create_recipe_pdf():
1213
"""Create a PDF with 25 basic recipes."""
1314

@@ -138,49 +139,50 @@ def create_recipe_pdf():
138139
"instructions": "Sear beef. Wrap in mushroom mixture and prosciutto. Encase in pastry. Bake until golden."
139140
}
140141
]
141-
142+
142143
# Create PDF
143144
current_dir = os.path.dirname(os.path.abspath(__file__))
144145
parent_dir = os.path.dirname(current_dir)
145146
pdf_path = os.path.join(parent_dir, "basic_recipes2.pdf")
146147
doc = SimpleDocTemplate(pdf_path, pagesize=letter)
147148
styles = getSampleStyleSheet()
148149
story = []
149-
150+
150151
# Title page
151152
title = Paragraph("Basic Recipes Collection 2", styles['Title'])
152153
story.append(title)
153154
story.append(Spacer(1, 0.5*inch))
154-
155+
155156
# Add recipes
156157
for i, recipe in enumerate(recipes, 1):
157158
# Recipe title
158159
recipe_title = Paragraph(f"{i}. {recipe['title']}", styles['Heading2'])
159160
story.append(recipe_title)
160161
story.append(Spacer(1, 0.1*inch))
161-
162+
162163
# Ingredients
163164
ingredients_title = Paragraph("Ingredients:", styles['Heading3'])
164165
story.append(ingredients_title)
165-
166+
166167
for ingredient in recipe['ingredients']:
167168
ingredient_text = Paragraph(f"• {ingredient}", styles['Normal'])
168169
story.append(ingredient_text)
169-
170+
170171
story.append(Spacer(1, 0.1*inch))
171-
172+
172173
# Instructions
173174
instructions_title = Paragraph("Instructions:", styles['Heading3'])
174175
story.append(instructions_title)
175-
176+
176177
instructions_text = Paragraph(recipe['instructions'], styles['Normal'])
177178
story.append(instructions_text)
178-
179+
179180
story.append(Spacer(1, 0.3*inch))
180-
181+
181182
# Build PDF
182183
doc.build(story)
183184
print("PDF created successfully")
184185

186+
185187
if __name__ == "__main__":
186-
create_recipe_pdf()
188+
create_recipe_pdf()

0 commit comments

Comments
 (0)