diff options
author | Théo de la Hogue | 2024-01-18 13:12:39 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-01-18 13:12:39 +0100 |
commit | c98e3baa548791d7a627b37f287915a3f30585d1 (patch) | |
tree | 56a0918ac4baa97667bfa642f4223a50d58ef4dd /src/argaze.test | |
parent | 25e300edf6a21ff8a0b8f7d8f38d4ecb9a3851c0 (diff) | |
download | argaze-c98e3baa548791d7a627b37f287915a3f30585d1.zip argaze-c98e3baa548791d7a627b37f287915a3f30585d1.tar.gz argaze-c98e3baa548791d7a627b37f287915a3f30585d1.tar.bz2 argaze-c98e3baa548791d7a627b37f287915a3f30585d1.tar.xz |
First work on TimestampedDataLogger system. Replacing log attribute by loggers dictionary in ArFrame and ArLayer.
Diffstat (limited to 'src/argaze.test')
-rw-r--r-- | src/argaze.test/DataLog/File.py | 37 | ||||
-rw-r--r-- | src/argaze.test/DataLog/__init__.py | 0 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/argaze.test/DataLog/File.py b/src/argaze.test/DataLog/File.py new file mode 100644 index 0000000..2d66ea6 --- /dev/null +++ b/src/argaze.test/DataLog/File.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +""" """ + +__author__ = "Théo de la Hogue" +__credits__ = [] +__copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)" +__license__ = "BSD" + +import unittest +import os + +from argaze import DataFeatures +from argaze.DataLog import File +from argaze.utils import UtilsFeatures + +DataFeaturesTest = UtilsFeatures.importFromTestPackage('DataFeatures') + +class TestTimeStampedDataLogger(unittest.TestCase): + """Test DataLogger class.""" + + def test_creation(self): + """Test logger creation.""" + + file_logger = File.TimeStampedDataLogger(path='./_export/logs/data.txt', separator=',') + + # Check file creation + self.assertEqual(os.path.exists('./_export/logs/data.txt'), True) + + # Write into file + file_logger.emit(0, 'A') + file_logger.emit(1, 'B') + file_logger.emit(2, 'C') + +if __name__ == '__main__': + + unittest.main()
\ No newline at end of file diff --git a/src/argaze.test/DataLog/__init__.py b/src/argaze.test/DataLog/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/argaze.test/DataLog/__init__.py |