#NEWLINE# def test_constructor_range( self ) : #NEWLINE# #INDENT# self . assertRaises ( TypeError , ( lambda : RangeIndex ( range ( 1 , 5 , 2 ) ) ) ) #NEWLINE# result = RangeIndex . from_range ( range ( 1 , 5 , 2 ) ) #NEWLINE# expected = RangeIndex ( 1 , 5 , 2 ) #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# result = RangeIndex . from_range ( range ( 5 , 6 ) ) #NEWLINE# expected = RangeIndex ( 5 , 6 , 1 ) #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# result = RangeIndex . from_range ( range ( 5 , 1 ) ) #NEWLINE# expected = RangeIndex ( 0 , 0 , 1 ) #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# result = RangeIndex . from_range ( range ( 5 ) ) #NEWLINE# expected = RangeIndex ( 0 , 5 , 1 ) #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# result = Index ( range ( 1 , 5 , 2 ) ) #NEWLINE# expected = RangeIndex ( 1 , 5 , 2 ) #NEWLINE# self . assertTrue ( result . equals ( expected ) ) #NEWLINE# self . assertRaises ( TypeError , ( lambda : Index ( range ( 1 , 5 , 2 ) , dtype = 'float64' ) ) )