Skip to content

Commit c5e6d1a

Browse files
committed
Final stuff
1 parent 14ceb50 commit c5e6d1a

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.doc_gen/metadata/scheduler_metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ scheduler_ScheduledEventsWorkflow:
151151
genai: some
152152
snippet_tags:
153153
- python.example_code.scheduler.FeatureScenario
154-
- description: Define a class that wraps &EVlong; Scheduler actions.
154+
- description: SchedulerWrapper class that wraps &EVlong; Scheduler actions.
155155
genai: some
156156
snippet_tags:
157157
- python.example_code.scheduler.EventSchedulerWrapper.class
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
boto3>=1.35.38
2-
pytest>=8.3.3
3-
botocore>=1.35.38
1+
boto3>=1.35.38

python/example_code/scheduler/scenario/scheduler_scenario.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@
1515
from boto3.resources.base import ServiceResource
1616
from boto3 import resource
1717

18+
script_dir = os.path.dirname(os.path.abspath(__file__))
19+
1820
# Add relative path to include SchedulerWrapper.
19-
sys.path.append('..')
21+
sys.path.append(os.path.dirname(script_dir))
2022
from scheduler_wrapper import SchedulerWrapper
2123

2224
# Add relative path to include demo_tools in this code example without need for setup.
23-
sys.path.append("../../..")
25+
sys.path.append(os.path.join(script_dir, "../../.."))
2426
import demo_tools.question as q
2527

2628

29+
30+
2731
DASHES = "-" * 80
2832

2933
sys.path
@@ -93,7 +97,6 @@ def prepare_application(self) -> None:
9397
email_address = q.ask("Enter an email address to use for event subscriptions: ")
9498
stack_name = q.ask("Enter a name for the AWS Cloud Formation Stack: ")
9599

96-
script_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
97100
template_file = SchedulerScenario.get_template_as_string()
98101

99102
parameters = [{"ParameterKey": "email", "ParameterValue": email_address}]

python/example_code/scheduler/scenario/test/conftest.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
99

1010
import boto3
1111
import pytest
12+
import os
1213

14+
15+
script_dir = os.path.dirname(os.path.abspath(__file__))
16+
17+
# Add relative path to include SchedulerWrapper.
18+
sys.path.append(script_dir)
19+
sys.path.append(os.path.dirname(script_dir))
1320
import scheduler_scenario
1421
from scheduler_wrapper import SchedulerWrapper
1522

16-
# This is needed so Python can find test_tools on the path.
17-
sys.path.append("../..")
23+
# Add relative path to include demo_tools in this code example without need for setup.
24+
sys.path.append(os.path.join(script_dir, "../../.."))
25+
1826
from test_tools.fixtures.common import *
1927

2028

0 commit comments

Comments
 (0)