'Test problems that have special types as indices.'

def test_non_python_int_index(self):

    import sys
    if (sys.version_info > (3,)):
        my_long = int
    else:
        my_long = long
    cost = self.x[0:my_long(2)][0]
    p = Problem(Minimize(cost), [(self.x == 1)])
    result = p.solve()
    self.assertAlmostEqual(result, 1)
    self.assertItemsAlmostEqual(self.x.value, [1, 1])
    cost = self.x[0:numpy.int64(2)][0]
    p = Problem(Minimize(cost), [(self.x == 1)])
    result = p.solve()
    self.assertAlmostEqual(result, 1)
    self.assertItemsAlmostEqual(self.x.value, [1, 1])
    cost = self.x[numpy.float32(0)]
    p = Problem(Minimize(cost), [(self.x == 1)])
    result = p.solve()
    self.assertAlmostEqual(result, 1)
    self.assertItemsAlmostEqual(self.x.value, [1, 1])
