def test_to_metric(): uvf = UVFlag(test_f_file) uvf.to_flag() nt.assert_true(hasattr(uvf, 'flag_array')) nt.assert_false(hasattr(uvf, 'metric_array')) nt.assert_true(uvf.mode == 'flag') uvf.to_metric() nt.assert_true(hasattr(uvf, 'metric_array')) nt.assert_false(hasattr(uvf, 'flag_array')) nt.assert_true(uvf.mode == 'metric') nt.assert_true('Converted to mode "metric"' in uvf.history)
def test_metric_to_metric(): uvf = UVFlag(test_f_file) uvf2 = uvf.copy() uvf.to_metric() nt.assert_equal(uvf, uvf2)