@@ -54,7 +54,7 @@ function testExportNwbFileWithMissingRequiredLink(testCase)
54
54
% an error.
55
55
56
56
electrode = types .core .IntracellularElectrode(' description' , ' test' );
57
- testCase .NwbObject .general_intracellular_ephys .set(' Electrode' , electrode )
57
+ testCase .NwbObject .general_intracellular_ephys .set(' Electrode' , electrode );
58
58
59
59
nwbFilePath = ' testExportNwbFileWithMissingRequiredLink.nwb' ;
60
60
testCase .verifyError(@(f , fn ) nwbExport(testCase .NwbObject , nwbFilePath ), ...
@@ -88,6 +88,7 @@ function testExportWithMissingRequiredDependentProperty(testCase)
88
88
end
89
89
90
90
function testExportFileWithAttributeOfEmptyDataset(testCase )
91
+ import matlab .unittest .fixtures .SuppressedWarningsFixture
91
92
92
93
nwbFile = testCase .initNwbFile();
93
94
@@ -106,10 +107,12 @@ function testExportFileWithAttributeOfEmptyDataset(testCase)
106
107
@() nwbExport(nwbFile , ' test_1.nwb' ))
107
108
108
109
% Change value for attribute of the grid_spacing dataset.
109
- % Because grid_spacing is not set, this attribute value is not
110
- % exported to the file. Verify that warning is issued.
110
+ testCase .applyFixture(...
111
+ SuppressedWarningsFixture( ' NWB:AttributeDependencyNotSet ' ))
111
112
imaging_plane.grid_spacing_unit = " microns" ;
112
113
114
+ % Because grid_spacing is not set, this attribute value is not
115
+ % exported to the file. Verify that warning is issued on export.
113
116
testCase .verifyWarning(...
114
117
@() nwbExport(nwbFile , ' test_2.nwb' ), ...
115
118
' NWB:DependentAttributeNotExported' )
@@ -129,9 +132,15 @@ function testExportTimeseriesWithMissingTimestampsAndStartingTime(testCase)
129
132
end
130
133
131
134
function testExportDependentAttributeWithMissingParentA(testCase )
135
+ import matlab .unittest .fixtures .SuppressedWarningsFixture
136
+ testCase .applyFixture(...
137
+ SuppressedWarningsFixture(' NWB:AttributeDependencyNotSet' ))
138
+
132
139
testCase.NwbObject.general_source_script_file_name = ' my_test_script.m' ;
133
140
nwbFilePath = fullfile(testCase .OutputFolder , ' test_part1.nwb' );
134
- testCase .verifyWarning(@(f , fn ) nwbExport(testCase .NwbObject , nwbFilePath ), ' NWB:DependentAttributeNotExported' )
141
+ testCase .verifyWarning(...
142
+ @(f , fn ) nwbExport(testCase .NwbObject , nwbFilePath ), ...
143
+ ' NWB:DependentAttributeNotExported' )
135
144
136
145
% Add value for dataset which attribute depends on and export again
137
146
testCase.NwbObject.general_source_script = ' my test' ;
0 commit comments