notscared / notscared2-main / tests / dbtozarr_test.py
dbtozarr_test.py
Raw
import sys
import unittest
sys.path.append('.')

import notscared.converters as conv


class TestConverter(unittest.TestCase):
    def setUp(self):
        self.converter = conv.Converter()

    def test_db_to_h5(self):
        # Test case setup
        db_path = "test.db"
        table_name = 'traces'
        columns = ['samples', 'ptxt', 'ctxt', 'tile_x', 'tile_y']

        # Run the method
        self.converter.db_to_zarr(db_path, table_name, columns)

        zarr_path = db_path.replace(".db", ".zarr")
        # Assertions
        self.assertEqual(zarr_path, "test.zarr")

if __name__ == '__main__':
    unittest.main()