1
# Copyright © 2011-2012 Christopher Foo <chris.foo@gmail.com>
3
# This file is part of Lolram.
5
# Lolram is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation, either version 3 of the License, or
8
# (at your option) any later version.
10
# Lolram is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with Lolram. If not, see <http://www.gnu.org/licenses/>.
19
import lolram.coroutines
23
def my_undec_coroutine():
28
@lolram.coroutines.coroutine
34
class TestCoroutine(unittest.TestCase):
35
def test_failure(self):
36
'''It should not automatically start the coroutine'''
38
c = my_undec_coroutine()
43
self.assertRaises(TypeError, f)
45
def test_coroutine(self):
46
'''It should automatically start the coroutine'''
51
if __name__ == "__main__":
52
#import sys;sys.argv = ['', 'Test.testName']