-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lambda] Fix missing private ip (#4635)
* [Lambda] Fix missing private ip * remove extra API call * format test
- Loading branch information
1 parent
3b4f31b
commit e4ad98c
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from sky.provision.lambda_cloud.instance import _get_private_ip | ||
|
||
|
||
def test_get_private_ip(): | ||
valid_info = {'private_ip': '10.19.83.125'} | ||
invalid_info = {} | ||
assert _get_private_ip(valid_info, | ||
single_node=True) == valid_info['private_ip'] | ||
assert _get_private_ip(valid_info, | ||
single_node=False) == valid_info['private_ip'] | ||
assert _get_private_ip(invalid_info, single_node=True) == '127.0.0.1' | ||
with pytest.raises(RuntimeError): | ||
_get_private_ip(invalid_info, single_node=False) |