-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds a flag that enables a sort of 'tutorial' mode where an example key is inserted to the stash for the user to try out and `get`
- Loading branch information
David Ginzbourg
committed
May 29, 2017
1 parent
d9fff63
commit f828246
Showing
3 changed files
with
65 additions
and
4 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 |
---|---|---|
|
@@ -862,6 +862,13 @@ def assert_stash_initialized(stash_path): | |
assert len(db) == 1 | ||
|
||
|
||
def assert_stash_initialized_tutorial(stash_path): | ||
db = get_tinydb(stash_path) | ||
assert '2' in db | ||
assert db['2']['name'] == 'example' | ||
assert len(db) == 2 | ||
|
||
|
||
def assert_key_put(db, dont_verify_value=False): | ||
key = db['2'] | ||
assert key['name'] == 'aws' | ||
|
@@ -1227,7 +1234,7 @@ def test_cli_stash(stash_path): | |
os.close(fd) | ||
os.remove(passphrase_file_path) | ||
ghost.PASSPHRASE_FILENAME = passphrase_file_path | ||
_invoke('init_stash "{0}"'.format(stash_path)) | ||
_invoke('init_stash -s "{0}"'.format(stash_path)) | ||
os.environ['GHOST_STASH_PATH'] = stash_path | ||
with open(passphrase_file_path) as passphrase_file: | ||
passphrase = passphrase_file.read() | ||
|
@@ -1642,6 +1649,10 @@ def test_ssh_with_key_path_and_extension(self, test_cli_stash): | |
'ssh -i /path/to/key [email protected] -o Key="Value"' | ||
assert expected_command in str(result.exception) | ||
|
||
def test_tutorial(self, stash_path): | ||
_invoke('init_stash "{0}" -t'.format(stash_path)) | ||
assert_stash_initialized_tutorial(stash_path) | ||
|
||
|
||
class TestMultiStash: | ||
# TODO: Test that migrate works when using multi-stash mode | ||
|