diff options
author | Théo de la Hogue | 2024-01-18 20:41:09 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-01-18 20:41:09 +0100 |
commit | 032f3282798f2c7120cc28ffe137191838a87452 (patch) | |
tree | f6c11f1c8f3d86bdb369b4f4bd7fcf039c52e32a /src/argaze.test/DataLog/FileWriter.py | |
parent | d6f68a4adc6f8c1af0697710dfcadb8b22194f3b (diff) | |
download | argaze-032f3282798f2c7120cc28ffe137191838a87452.zip argaze-032f3282798f2c7120cc28ffe137191838a87452.tar.gz argaze-032f3282798f2c7120cc28ffe137191838a87452.tar.bz2 argaze-032f3282798f2c7120cc28ffe137191838a87452.tar.xz |
Renaming File into FileWriter.
Diffstat (limited to 'src/argaze.test/DataLog/FileWriter.py')
-rw-r--r-- | src/argaze.test/DataLog/FileWriter.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/argaze.test/DataLog/FileWriter.py b/src/argaze.test/DataLog/FileWriter.py new file mode 100644 index 0000000..648385c --- /dev/null +++ b/src/argaze.test/DataLog/FileWriter.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 FileWriter +from argaze.utils import UtilsFeatures + +DataFeaturesTest = UtilsFeatures.importFromTestPackage('DataFeatures') + +class TestTimeStampedDataLogger(unittest.TestCase): + """Test DataLogger class.""" + + def test_creation(self): + """Test logger creation.""" + + file_writer = FileWriter.TimeStampedDataLogger(path='./_export/logs/data.txt', separator=',') + + # Check file creation + self.assertEqual(os.path.exists('./_export/logs/data.txt'), True) + + # Write into file + file_writer.emit(0, 'A') + file_writer.emit(1, 'B') + file_writer.emit(2, 'C') + +if __name__ == '__main__': + + unittest.main()
\ No newline at end of file |