# Path: crowd_anki/utils/utils.py
# def merge_dicts(*dict_args):
# def add_column(db, table_name, column_name, default_value="\"\""):
# def add_absent_field(object_to_modify, field_name, default_value=None):
# def json_compare(first, second):
# def fs_remove(path):
# def list_to_cs_string(uf_list: list) -> str:
# def string_cs_to_list(f_list: str) -> list:


import unittest
from pathlib import Path
from crowd_anki.utils import utils



class FsRemoveTest(unittest.TestCase):
    def setUp(self):
        self.dirpath = Path("testdir")
        self.filepath = Path("testdir").joinpath("testfile")

        try:
            self.dirpath.mkdir()
        except:
            pass

        self.filepath.touch(exist_ok=True)

    def test_rmfile(self):
        self.assertTrue(self.filepath.exists())
        utils.fs_remove(self.filepath)
        self.assertFalse(self.filepath.exists())

    def test_rmdir(self):

# Path: crowd_anki/utils/utils.py
# def merge_dicts(*dict_args):
# def add_column(db, table_name, column_name, default_value="\"\""):
# def add_absent_field(object_to_modify, field_name, default_value=None):
# def json_compare(first, second):
# def fs_remove(path):
# def list_to_cs_string(uf_list: list) -> str:
# def string_cs_to_list(f_list: str) -> list:


# Path: crowd_anki/test/test_utils.py
import unittest
from pathlib import Path
from crowd_anki.utils import utils




class FsRemoveTest(unittest.TestCase):
    def setUp(self):
        self.dirpath = Path("testdir")
        self.filepath = Path("testdir").joinpath("testfile")

        try:
            self.dirpath.mkdir()
        except:
            pass

        self.filepath.touch(exist_ok=True)

    def test_rmfile(self):
        self.assertTrue(self.filepath.exists())
        utils.fs_remove(self.filepath)
        self.assertFalse(self.filepath.exists())

    def test_rmdir(self):

        utils.fs_remove(self.dirpath)