Former-commit-id:06a8b51d6d
[formerly9f19e3f712
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]] Former-commit-id:9f19e3f712
Former-commit-id:a02aeb236c
32 lines
No EOL
685 B
Python
Executable file
32 lines
No EOL
685 B
Python
Executable file
|
|
from nose.tools import eq_
|
|
from nose.plugins.attrib import attr
|
|
|
|
def test_flags():
|
|
# @attr('one','two')
|
|
def test():
|
|
pass
|
|
test = attr('one','two')(test)
|
|
|
|
eq_(test.one, 1)
|
|
eq_(test.two, 1)
|
|
|
|
def test_values():
|
|
# @attr(mood="hohum", colors=['red','blue'])
|
|
def test():
|
|
pass
|
|
test = attr(mood="hohum", colors=['red','blue'])(test)
|
|
|
|
eq_(test.mood, "hohum")
|
|
eq_(test.colors, ['red','blue'])
|
|
|
|
def test_mixed():
|
|
# @attr('slow', 'net', role='integration')
|
|
def test():
|
|
pass
|
|
test = attr('slow', 'net', role='integration')(test)
|
|
|
|
eq_(test.slow, 1)
|
|
eq_(test.net, 1)
|
|
eq_(test.role, 'integration')
|
|
|