-
Notifications
You must be signed in to change notification settings - Fork 892
fix(python-sdk): missing functions in AsyncSandbox.git #1109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import asyncio | ||
| import inspect | ||
|
|
||
| from e2b.sandbox_async.git import Git as AsyncGit | ||
| from e2b.sandbox_sync.git import Git as SyncGit | ||
|
|
||
|
|
||
| def _public_methods(cls): | ||
| return { | ||
| name: getattr(cls, name) | ||
| for name in sorted(dir(cls)) | ||
| if not name.startswith("_") and callable(getattr(cls, name)) | ||
| } | ||
|
|
||
|
|
||
| def test_identical_method_signatures(): | ||
| sync = _public_methods(SyncGit) | ||
| async_ = _public_methods(AsyncGit) | ||
|
|
||
| assert set(sync) == set(async_), ( | ||
| f"missing from async: {set(sync) - set(async_)}, " | ||
| f"missing from sync: {set(async_) - set(sync)}" | ||
| ) | ||
|
|
||
| for name in sync: | ||
| assert inspect.signature(sync[name]) == inspect.signature(async_[name]), ( | ||
| f"{name}: sync{inspect.signature(sync[name])} " | ||
| f"!= async{inspect.signature(async_[name])}" | ||
| ) | ||
|
|
||
|
|
||
| def test_async_methods_are_coroutines(): | ||
| for name, method in _public_methods(AsyncGit).items(): | ||
| assert asyncio.iscoroutinefunction(method), f"AsyncGit.{name} is not async" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Getting
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for flagging this! I wasn’t available at the time, but I see you’ve already resolved it - turns out my local dev env was using an older Python binary. |
||
Uh oh!
There was an error while loading. Please reload this page.