-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #504 from sudorandom/rename-some-of-the-things
Use slcli command over sl
- Loading branch information
Showing
16 changed files
with
99 additions
and
59 deletions.
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
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 @@ | ||
""" | ||
SoftLayer.CLI.deprecated | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Handles usage of the deprecated command name, 'sl'. | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
from __future__ import print_function | ||
import sys | ||
|
||
|
||
def main(): | ||
"""Main function for the deprecated 'sl' command.""" | ||
print("ERROR: Use the 'slcli' command instead.", file=sys.stderr) | ||
print("> slcli %s" % ' '.join(sys.argv[1:]), file=sys.stderr) | ||
exit(-1) |
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
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
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,32 @@ | ||
""" | ||
SoftLayer.tests.CLI.deprecated_tests | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
import mock | ||
|
||
from SoftLayer.CLI import deprecated | ||
from SoftLayer import testing | ||
from SoftLayer import utils | ||
|
||
|
||
class EnvironmentTests(testing.TestCase): | ||
|
||
def test_main(self): | ||
|
||
with mock.patch('sys.stderr', new=utils.StringIO()) as fake_out: | ||
ex = self.assertRaises(SystemExit, deprecated.main) | ||
self.assertEqual(ex.code, -1) | ||
|
||
self.assertIn("ERROR: Use the 'slcli' command instead.", | ||
fake_out.getvalue()) | ||
|
||
def test_with_args(self): | ||
with mock.patch('sys.stderr', new=utils.StringIO()) as fake_out: | ||
with mock.patch('sys.argv', new=['sl', 'module', 'subcommand']): | ||
ex = self.assertRaises(SystemExit, deprecated.main) | ||
self.assertEqual(ex.code, -1) | ||
|
||
self.assertIn("ERROR: Use the 'slcli' command instead.", | ||
fake_out.getvalue()) |
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
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
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
Oops, something went wrong.