def test_set_record_struct(self): """ Test the :mod:`db_set_record_struct` module """ # GIVEN: A mocked out SongImport class, a mocked out struct class, and a mocked out "manager" and a list of # field descriptions with patch('openlp.plugins.songs.lib.importers.easyworship.SongImport'), \ patch('openlp.plugins.songs.lib.importers.easyworship.struct') as mocked_struct: mocked_manager = MagicMock() importer = EasyWorshipSongImport(mocked_manager, file_paths=[]) # WHEN: db_set_record_struct is called with a list of field descriptions return_value = importer.db_set_record_struct(TEST_FIELD_DESCS) # THEN: db_set_record_struct should return None and Struct should be called with a value representing # the list of field descriptions assert return_value is None, 'db_set_record_struct should return None' mocked_struct.Struct.assert_called_with('>50sHIB250s250s10sQ')