from cyinterval.cyinterval import Interval, IntervalSet
from nose.tools import assert_equal

def test_interval_set_construction():
    interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.))
    assert_equal(interval_set.intervals[0], Interval(0.,1.))
    assert_equal(interval_set.intervals[1], Interval(2.,3.))

if __name__ == '__main__':
    import sys
    import nose
    # This code will run the test in this file.'
    module_name = sys.modules[__name__].__file__

    result = nose.run(argv=[sys.argv[0],
                            module_name,
                            '-s', '-v'])


from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet
from nose.tools import assert_equal, assert_is

def test_float_interval_set_construction():
    interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.))
    assert_equal(interval_set.intervals[0], Interval(0.,1.))
    assert_equal(interval_set.intervals[1], Interval(2.,3.))
    assert_is(type(interval_set), FloatIntervalSet)

if __name__ == '__main__':
    import sys
    import nose
    # This code will run the test in this file.'
    module_name = sys.modules[__name__].__file__

    result = nose.run(argv=[sys.argv[0],
                            module_name,
                            '-s', '-v'])


Test type of IntervalSet factory output
Test type of IntervalSet factory output

- from cyinterval.cyinterval import Interval, IntervalSet
+ from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet
- from nose.tools import assert_equal
+ from nose.tools import assert_equal, assert_is
  
- def test_interval_set_construction():
+ def test_float_interval_set_construction():
      interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.))
      assert_equal(interval_set.intervals[0], Interval(0.,1.))
      assert_equal(interval_set.intervals[1], Interval(2.,3.))
+     assert_is(type(interval_set), FloatIntervalSet)
  
  if __name__ == '__main__':
      import sys
      import nose
      # This code will run the test in this file.'
      module_name = sys.modules[__name__].__file__
  
      result = nose.run(argv=[sys.argv[0],
                              module_name,
                              '-s', '-v'])
  
  
Test type of IntervalSet factory output
## Code Before:
from cyinterval.cyinterval import Interval, IntervalSet
from nose.tools import assert_equal

def test_interval_set_construction():
    interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.))
    assert_equal(interval_set.intervals[0], Interval(0.,1.))
    assert_equal(interval_set.intervals[1], Interval(2.,3.))

if __name__ == '__main__':
    import sys
    import nose
    # This code will run the test in this file.'
    module_name = sys.modules[__name__].__file__

    result = nose.run(argv=[sys.argv[0],
                            module_name,
                            '-s', '-v'])


## Instruction:
Test type of IntervalSet factory output
## Code After:
from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet
from nose.tools import assert_equal, assert_is

def test_float_interval_set_construction():
    interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.))
    assert_equal(interval_set.intervals[0], Interval(0.,1.))
    assert_equal(interval_set.intervals[1], Interval(2.,3.))
    assert_is(type(interval_set), FloatIntervalSet)

if __name__ == '__main__':
    import sys
    import nose
    # This code will run the test in this file.'
    module_name = sys.modules[__name__].__file__

    result = nose.run(argv=[sys.argv[0],
                            module_name,
                            '-s', '-v'])

