[Feature request] SageMaker list and notebook instances
Currently Moto can create a fake SageMaker notebook instance, and delete it, and describe it's lifecycle config, and list tags for it.
I want to add functionality to list notebook instances, including the list_notebook_instances paginator.
This is something I'll attempt myself. But I'm just raising a ticket so other people get visibility.
I just ran python scripts/scaffold.py and typed in sagemaker and list_notebook_instances.
I can't see anything added for the paginator. Is there any scaffold script to add that for me?
When I run git status to see what the scaffold.py script did, I see:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: moto/sagemaker/models.py
modified: moto/sagemaker/responses.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
tests/test_sagemaker/test_sagemaker.py
tests/test_sagemaker/test_server.py
Why did it create
tests/test_sagemaker/test_sagemaker.py? Shouldn't I add these tests to test_sagemaker_notebooks.py?
What goes into tests/test_sagemaker/test_server.py?
(The files in moto/sagemaker/ I can probably figure out.)
Hi @mdavis-xyz, thanks for raising this!
There is no automated way to add the paginator (yet).
The script will always create test_{service}.py if it doesn't exist.
And yes, it would make more sense to use test_sagemaker_notebooks.py. The script just isn't smart enough to figure that out.
What goes into tests/test_sagemaker/test_server.py
Having a test_server.py-file can be useful if you want to send raw HTTP-requests, and verify that Moto gives the appropriate response.
However, all sagemaker-features can be tested by boto3-tests afaik, so in this case you can just delete the file.