Beispiel #1
0
class CopyArrayTest(unittest.TestCase):
    def setUp(self):
        self.int_array = np.arange(0, 10, dtype=int);
        self.float_array = np.arange(0, 10, 0.5, dtype=float);

        self.copy_obj = CopyTest();

    def test_float_array(self):
        self.copy_obj.set_f_data(self.float_array);
        data = self.copy_obj.get_f_data();
        self.assertItemsEqual(self.float_array, data);

    def test_int_array(self):
        self.copy_obj.set_i_data(self.int_array);
        data = self.copy_obj.get_i_data();
        self.assertItemsEqual(self.int_array, data);

    def test_update_f_data(self):
        self.copy_obj.set_f_data(self.float_array);
        data = self.copy_obj.get_f_data();
        data[0] = -1;
        self.assertEqual(-1, self.copy_obj.get_f_data()[0]);
class CopyArrayTest(unittest.TestCase):
    def setUp(self):
        self.int_array = np.arange(0, 10, dtype=int)
        self.float_array = np.arange(0, 10, 0.5, dtype=float)

        self.copy_obj = CopyTest()

    def test_float_array(self):
        self.copy_obj.set_f_data(self.float_array)
        data = self.copy_obj.get_f_data()
        self.assertItemsEqual(self.float_array, data)

    def test_int_array(self):
        self.copy_obj.set_i_data(self.int_array)
        data = self.copy_obj.get_i_data()
        self.assertItemsEqual(self.int_array, data)

    def test_update_f_data(self):
        self.copy_obj.set_f_data(self.float_array)
        data = self.copy_obj.get_f_data()
        data[0] = -1
        self.assertEqual(-1,
                         self.copy_obj.get_f_data()[0])
    def setUp(self):
        self.int_array = np.arange(0, 10, dtype=int)
        self.float_array = np.arange(0, 10, 0.5, dtype=float)

        self.copy_obj = CopyTest()
Beispiel #4
0
    def setUp(self):
        self.int_array = np.arange(0, 10, dtype=int);
        self.float_array = np.arange(0, 10, 0.5, dtype=float);

        self.copy_obj = CopyTest();