def test_logging(self): # pylint: disable=R0201 """cppcore: Testing logging""" import efel tempdir = tempfile.mkdtemp('efel_tests') try: efel.cppcore.Initialize(efel.getDependencyFileLocation(), tempdir) self.setup_data() with open(os.path.join(tempdir, 'fllog.txt')) as fd: contents = fd.read() nt.ok_('Initializing' in contents) # test vector working (if more than 10 elements, prints ... nt.ok_('...' in contents) # re-call efel's Initialize with current dir # to remove pointer to tempdir. # this pointer was preventing the deletion of tempdir on windows. efel.cppcore.Initialize(efel.getDependencyFileLocation(), '.') finally: shutil.rmtree(tempdir)
def test_logging(self): # pylint: disable=R0201 """cppcore: Testing logging""" import efel tempdir = tempfile.mkdtemp('efel_tests') try: efel.cppcore.Initialize(efel.getDependencyFileLocation(), tempdir) self.setup_data() with open(os.path.join(tempdir, 'fllog.txt')) as fd: contents = fd.read() nt.ok_('Initializing' in contents) # test vector working (if more than 10 elements, prints ... nt.ok_('...' in contents) finally: shutil.rmtree(tempdir)
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import efel import json if __name__ == '__main__': print("Updating featurenames.json ...", end=' ') efel.cppcore.Initialize(efel.getDependencyFileLocation(), "log") with open('featurenames.json', 'w') as featurenames_json: feature_names = [] efel.cppcore.getFeatureNames(feature_names) json.dump( feature_names, featurenames_json, indent=4, separators=( ',', ': ')) print("done")
def setup(self): """Setup""" import efel efel.cppcore.Initialize(efel.getDependencyFileLocation(), "log")
def setup(self): # pylint: disable=R0201 """Setup""" import efel efel.cppcore.Initialize(efel.getDependencyFileLocation(), "log")