File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2572,6 +2572,30 @@ def test_Field_set_construct_conform(self):
2572
2572
cm2 = f .cell_method ("method:maximum" )
2573
2573
self .assertEqual (cm2 .get_axes (), ("T" ,))
2574
2574
2575
+ def test_Field_del_construct (self ):
2576
+ """Test the `del_construct` Field method."""
2577
+ # Test a field without cyclic axes. These are equivalent tests to those
2578
+ # in the cfdm test suite, to check the behaviour is the same in cf.
2579
+ f = self .f1 .copy ()
2580
+ print (f .cyclic ())
2581
+
2582
+ self .assertIsInstance (
2583
+ f .del_construct ("auxiliarycoordinate1" ), cf .AuxiliaryCoordinate
2584
+ )
2585
+
2586
+ with self .assertRaises (ValueError ):
2587
+ f .del_construct ("auxiliarycoordinate1" )
2588
+
2589
+ self .assertIsNone (
2590
+ f .del_construct ("auxiliarycoordinate1" , default = None )
2591
+ )
2592
+
2593
+ self .assertIsInstance (
2594
+ f .del_construct ("measure:area" ), cf .CellMeasure
2595
+ )
2596
+
2597
+ # TODO test cyclic nature
2598
+
2575
2599
def test_Field_persist (self ):
2576
2600
"""Test the `persist` Field method."""
2577
2601
f = cf .example_field (0 )
You can’t perform that action at this time.
0 commit comments