Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test runner, localized test command and tests for it
- Loading branch information
Showing
3 changed files
with
62 additions
and
3 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,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2014 Alexander Shorin | ||
# All rights reserved. | ||
# | ||
# This software is licensed as described in the file LICENSE, which | ||
# you should have received as part of this distribution. | ||
# | ||
|
||
import unittest | ||
from tasman.app import app | ||
|
||
|
||
class TestCmdTestCase(unittest.TestCase): | ||
|
||
def test_passed(self): | ||
environ = {'MESSAGE': 'test', 'XMPP_JID': 'k.bx@ya.ru'} | ||
|
||
rv = app(environ) | ||
self.assertEquals(list(rv), ['passed']) | ||
|
||
def test_passed_ru(self): | ||
environ = {'MESSAGE': u'тест', 'XMPP_JID': 'k.bx@ya.ru'} | ||
|
||
rv = app(environ) | ||
self.assertEquals(list(rv), [u'пассед']) | ||
|
||
def test_strict(self): | ||
environ = {'MESSAGE': 'test test test', 'XMPP_JID': 'k.bx@ya.ru'} | ||
|
||
rv = app(environ) | ||
self.assertEquals(list(rv), []) |