2013-08-22 12:17:10 +02:00
|
|
|
"""these tests are here to create some :class:`tiramisu.option.Option`'s
|
|
|
|
and to compare them
|
|
|
|
"""
|
2013-05-05 21:43:19 +02:00
|
|
|
import autopath
|
|
|
|
|
|
|
|
from tiramisu.option import BoolOption, IntOption
|
|
|
|
|
|
|
|
|
|
|
|
def test_option_comparison():
|
2013-08-22 12:17:10 +02:00
|
|
|
"compare :class:`tiramisu.option.BoolOption`"
|
2013-05-05 21:43:19 +02:00
|
|
|
dummy1 = BoolOption('dummy1', 'doc dummy')
|
|
|
|
dummy2 = BoolOption('dummy2', 'doc dummy')
|
|
|
|
dummy3 = BoolOption('dummy1', 'doc dummy')
|
|
|
|
assert dummy1 != dummy2
|
|
|
|
assert dummy1 == dummy3
|
|
|
|
|
|
|
|
|
|
|
|
def test_option_comparison_obj():
|
2013-08-22 12:17:10 +02:00
|
|
|
"compare :class:`tiramisu.option.IntOption`"
|
2013-05-05 21:43:19 +02:00
|
|
|
dummy1 = BoolOption('dummy1', 'doc dummy')
|
|
|
|
dummy2 = IntOption('dummy1', 'doc dummy')
|
|
|
|
assert dummy1 != dummy2
|
|
|
|
|
|
|
|
|
|
|
|
def test_option_comparison_advanced():
|
|
|
|
dummy1 = BoolOption('dummy1', 'doc dummy')
|
|
|
|
dummy2 = BoolOption('dummy1', 'doc dummy')
|
|
|
|
dummy3 = BoolOption('dummy1', 'doc dummy', None)
|
|
|
|
dummy4 = BoolOption('dummy1', 'doc dummy', True)
|
|
|
|
dummy5 = BoolOption('dummy1', 'doc dummy', multi=True)
|
|
|
|
dummy6 = BoolOption('dummy1', 'doc dummy', properties=tuple())
|
|
|
|
dummy7 = BoolOption('dummy1', 'doc dummy', properties=tuple('new',))
|
|
|
|
assert dummy1 == dummy2
|
|
|
|
assert dummy1 == dummy3
|
|
|
|
assert dummy1 != dummy4
|
|
|
|
assert dummy1 != dummy5
|
|
|
|
assert dummy1 == dummy6
|
|
|
|
assert dummy1 != dummy7
|