-
Notifications
You must be signed in to change notification settings - Fork 83
TPT-4527: Implemented changes for SLADE and CLEO projects #665
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
Open
ezilber-akamai
wants to merge
3
commits into
linode:proj/slade-cleo
Choose a base branch
from
ezilber-akamai:TPT-4257-slade-cleo
base: proj/slade-cleo
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -686,13 +686,140 @@ def test_instance_create(self): | |
|
|
||
| def test_instance_create_with_image(self): | ||
| """ | ||
| Tests that a Linode Instance can be created with an image, and a password generated | ||
| Tests that a Linode Instance can be created with an image and root_pass | ||
| """ | ||
| with self.mock_post("linode/instances/123") as m: | ||
| l, pw = self.client.linode.instance_create( | ||
| "g6-standard-1", | ||
| "us-east-1a", | ||
| image="linode/debian9", | ||
| root_pass="aComplex@Password123", | ||
| ) | ||
|
|
||
| self.assertIsNotNone(l) | ||
| self.assertEqual(l.id, 123) | ||
|
|
||
| self.assertEqual(m.call_url, "/linode/instances") | ||
|
|
||
| self.assertEqual( | ||
| m.call_data, | ||
| { | ||
| "region": "us-east-1a", | ||
| "type": "g6-standard-1", | ||
| "image": "linode/debian9", | ||
| "root_pass": "aComplex@Password123", | ||
| }, | ||
| ) | ||
|
|
||
| def test_instance_create_with_image_authorized_keys(self): | ||
| """ | ||
| Tests that a Linode Instance can be created with an image and authorized_keys only | ||
| """ | ||
| with self.mock_post("linode/instances/123") as m: | ||
| l = self.client.linode.instance_create( | ||
| "g6-standard-1", | ||
| "us-east-1a", | ||
| image="linode/debian9", | ||
| authorized_keys="ssh-rsa AAAA", | ||
| ) | ||
|
|
||
| self.assertIsNotNone(l) | ||
| self.assertEqual(l.id, 123) | ||
|
|
||
| self.assertEqual(m.call_url, "/linode/instances") | ||
|
|
||
| self.assertEqual( | ||
| m.call_data, | ||
| { | ||
| "region": "us-east-1a", | ||
| "type": "g6-standard-1", | ||
| "image": "linode/debian9", | ||
| "authorized_keys": ["ssh-rsa AAAA"], | ||
| }, | ||
| ) | ||
|
|
||
| def test_instance_create_with_image_requires_auth(self): | ||
| """ | ||
| Tests that creating an Instance from an Image without root_pass or | ||
| authorized_keys raises a ValueError | ||
| """ | ||
| with self.assertRaises(ValueError): | ||
| self.client.linode.instance_create( | ||
| "g6-standard-1", "us-east-1a", image="linode/debian9" | ||
| ) | ||
|
|
||
| def test_instance_create_with_kernel(self): | ||
| """ | ||
| Tests that a Linode Instance can be created with a kernel | ||
| """ | ||
| with self.mock_post("linode/instances/123") as m: | ||
| l, pw = self.client.linode.instance_create( | ||
| "g6-standard-1", | ||
| "us-east-1a", | ||
| image="linode/debian9", | ||
| root_pass="aComplex@Password123", | ||
| kernel="linode/latest-64bit", | ||
| ) | ||
|
|
||
| self.assertIsNotNone(l) | ||
| self.assertEqual(l.id, 123) | ||
|
|
||
| self.assertEqual(m.call_url, "/linode/instances") | ||
|
|
||
| self.assertEqual( | ||
| m.call_data, | ||
| { | ||
| "region": "us-east-1a", | ||
| "type": "g6-standard-1", | ||
| "image": "linode/debian9", | ||
| "root_pass": "aComplex@Password123", | ||
| "kernel": "linode/latest-64bit", | ||
| }, | ||
| ) | ||
|
|
||
| def test_instance_create_with_boot_size(self): | ||
| """ | ||
| Tests that a Linode Instance can be created with a boot_size | ||
| """ | ||
| with self.mock_post("linode/instances/123") as m: | ||
| l, pw = self.client.linode.instance_create( | ||
| "g6-standard-1", | ||
| "us-east-1a", | ||
| image="linode/debian9", | ||
| root_pass="aComplex@Password123", | ||
| boot_size=5000, | ||
|
Member
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.
|
||
| ) | ||
|
|
||
| self.assertIsNotNone(l) | ||
| self.assertEqual(l.id, 123) | ||
|
|
||
| self.assertEqual(m.call_url, "/linode/instances") | ||
|
|
||
| self.assertEqual( | ||
| m.call_data, | ||
| { | ||
| "region": "us-east-1a", | ||
| "type": "g6-standard-1", | ||
| "image": "linode/debian9", | ||
| "root_pass": "aComplex@Password123", | ||
| "boot_size": 5000, | ||
| }, | ||
| ) | ||
|
|
||
| def test_instance_create_with_kernel_and_boot_size(self): | ||
| """ | ||
| Tests that a Linode Instance can be created with both kernel and boot_size | ||
| """ | ||
| with self.mock_post("linode/instances/123") as m: | ||
| l, pw = self.client.linode.instance_create( | ||
| "g6-standard-1", | ||
| "us-east-1a", | ||
| image="linode/debian9", | ||
| root_pass="aComplex@Password123", | ||
| kernel="linode/latest-64bit", | ||
| boot_size=5000, | ||
| ) | ||
|
|
||
| self.assertIsNotNone(l) | ||
| self.assertEqual(l.id, 123) | ||
|
|
||
|
|
@@ -704,7 +831,9 @@ def test_instance_create_with_image(self): | |
| "region": "us-east-1a", | ||
| "type": "g6-standard-1", | ||
| "image": "linode/debian9", | ||
| "root_pass": pw, | ||
| "root_pass": "aComplex@Password123", | ||
| "kernel": "linode/latest-64bit", | ||
| "boot_size": 5000, | ||
| }, | ||
| ) | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.