-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for the local aliases feature
- Loading branch information
Sylvain Fankhauser
committed
Jul 30, 2014
1 parent
ae744fd
commit 7352851
Showing
2 changed files
with
51 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,39 @@ | ||
from freezegun import freeze_time | ||
|
||
from . import CommandTestCase | ||
|
||
|
||
@freeze_time('2014-01-20') | ||
class StatusCommandTestCase(CommandTestCase): | ||
def test_local_alias(self): | ||
config = self.default_config.copy() | ||
config['default']['local_aliases'] = '_pingpong' | ||
|
||
self.write_entries("""20/01/2014 | ||
_pingpong 0800-0900 Play ping-pong | ||
""") | ||
stdout = self.run_command('status', options=self.default_options) | ||
|
||
self.assertIn( | ||
"_pingpong (local) 1.00 Play ping-pong", | ||
stdout | ||
) | ||
|
||
def test_multiple_local_aliases(self): | ||
config = self.default_config.copy() | ||
config['default']['local_aliases'] = '_pingpong, _coffee' | ||
|
||
self.write_entries("""20/01/2014 | ||
_pingpong 0800-0900 Play ping-pong | ||
_coffee 0900-1000 Drink some coffee | ||
""") | ||
|
||
stdout = self.run_command('status', options=self.default_options) | ||
self.assertIn( | ||
"_pingpong (local) 1.00 Play ping-pong", | ||
stdout | ||
) | ||
self.assertIn( | ||
"_coffee (local) 1.00 Drink some coffee", | ||
stdout | ||
) |