def test_provider(self): provider = mock.Mock(read_data=lambda: mock.sentinel.DATA) field = Field([], [], None) field.set_data(provider) self.assertIs(field.get_data(), mock.sentinel.DATA)
def test_None(self): data = np.arange(12).reshape(3, 4) field = Field([], [], data) field.set_data(None) self.assertIsNone(field.get_data())
def test_ndarray(self): field = Field([], [], None) data = np.arange(12).reshape(3, 4) field.set_data(data) self.assertArrayEqual(field.get_data(), data)
def test_None(self): field = Field([], [], None) self.assertIsNone(field.get_data())
def test_ndarray(self): data = np.arange(12).reshape(3, 4) field = Field([], [], data) self.assertIs(field.get_data(), data)
def test_provider(self): provider = mock.Mock(read_data=lambda: mock.sentinel.DATA) field = Field([], [], None) field.set_data(provider) self.assertIs(field.get_data(), mock.sentinel.DATA)
def test_ndarray(self): field = Field([], [], None) data = np.arange(12).reshape(3, 4) field.set_data(data) self.assertArrayEqual(field.get_data(), data)
def test_None(self): data = np.arange(12).reshape(3, 4) field = Field([], [], data) field.set_data(None) self.assertIsNone(field.get_data())
def test_ndarray(self): data = np.arange(12).reshape(3, 4) field = Field([], [], data) self.assertIs(field.get_data(), data)
def test_None(self): field = Field([], [], None) self.assertIsNone(field.get_data())