-
Notifications
You must be signed in to change notification settings - Fork 63
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 #246 from earboxer/ls-fields
Command line interface: Implement --fields for list command
- Loading branch information
Showing
4 changed files
with
147 additions
and
63 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
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 |
---|---|---|
|
@@ -66,7 +66,7 @@ def test_simple_ls_without_options(self): | |
expected = [ | ||
"Address book: foo", | ||
"Index Name Phone " | ||
"E-Mail UID", | ||
"Email Uid", | ||
"1 second contact voice: 0123456789 " | ||
"home: [email protected] testuid1", | ||
"2 text birthday " | ||
|
@@ -75,6 +75,17 @@ def test_simple_ls_without_options(self): | |
" testuid2"] | ||
self.assertListEqual(text, expected) | ||
|
||
def test_ls_fields_like_email(self): | ||
with mock_stdout() as stdout: | ||
khard.main(['ls', '-p', '-F', 'emails.home.0,name']) | ||
text = stdout.getvalue().splitlines() | ||
expected = [ | ||
"[email protected]\tsecond contact", | ||
"\ttext birthday", | ||
"\tthird contact", | ||
] | ||
self.assertListEqual(text, expected) | ||
|
||
@mock.patch.dict('os.environ', LC_ALL='C') | ||
def test_simple_bdays_without_options(self): | ||
with mock_stdout() as stdout: | ||
|
@@ -135,7 +146,7 @@ def test_order_of_search_term_does_not_matter(self): | |
expected = [ | ||
"Address book: foo", | ||
"Index Name Phone " | ||
"E-Mail UID", | ||
"Email Uid", | ||
"1 second contact voice: 0123456789 " | ||
"home: [email protected] testuid1"] | ||
self.assertListEqual(text1, expected) | ||
|
@@ -151,7 +162,7 @@ def test_case_of_search_terms_does_not_matter(self): | |
expected = [ | ||
"Address book: foo", | ||
"Index Name Phone " | ||
"E-Mail UID", | ||
"Email Uid", | ||
"1 second contact voice: 0123456789 " | ||
"home: [email protected] testuid1"] | ||
self.assertListEqual(text1, expected) | ||
|
@@ -173,8 +184,8 @@ def test_list_bug_195(self): | |
text = [line.strip() for line in stdout.getvalue().splitlines()] | ||
expect = [ | ||
"Address book: tmp", | ||
"Index Name Phone E-Mail UID", | ||
"1 bug 195 cell: 67545678 b"] | ||
"Index Name Phone Email Uid", | ||
"1 bug 195 cell: 67545678 b"] | ||
self.assertListEqual(text, expect) | ||
|
||
def test_list_bug_243_part_1(self): | ||
|
@@ -186,7 +197,7 @@ def test_list_bug_243_part_1(self): | |
expect = [ | ||
"Address book: tmp", | ||
"Index Name Phone " | ||
"E-Mail UID", | ||
"Email Uid", | ||
"1 contact with category " | ||
"internet: [email protected] c", | ||
] | ||
|