# Path: email_parser/fs.py
# def _parse_params(pattern):
# def _has_correct_ext(path, pattern):
# def _emails(root_path, pattern, params):
# def get_email_filepath(email_name, locale):
# def get_template_filepath(root_path, template_name, template_type):
# def get_template_resources_filepaths(root_path, template):
# def emails(root_path, email_name=None, locale=None):
# def email(root_path, email_name, locale):
# def global_email(root_path, locale):
# def read_file(*path_parts):
# def save_file(content, *path_parts):
# def delete_file(*path_parts):
# def save_email(root_path, content, email_name, locale):
# def save_template(root_path, template_filename, template_type, template_content):
# def save_parsed_email(root_path, email, subject, text, html):
# def resources(root_path):
# def get_html_sections_map(root_path):


from unittest import TestCase
from unittest.mock import patch
from email_parser import fs
from email_parser.model import *


class MockPath(object):
    def __init__(self, path, is_dir=False, parent='.'):
        self.path = path
        self._is_dir = is_dir
        self.name = path.split('/')[-1]
        self._parent = parent
        if parent:
            self.parent = MockPath(parent, is_dir=True, parent=None)


# Path: email_parser/fs.py
# def _parse_params(pattern):
# def _has_correct_ext(path, pattern):
# def _emails(root_path, pattern, params):
# def get_email_filepath(email_name, locale):
# def get_template_filepath(root_path, template_name, template_type):
# def get_template_resources_filepaths(root_path, template):
# def emails(root_path, email_name=None, locale=None):
# def email(root_path, email_name, locale):
# def global_email(root_path, locale):
# def read_file(*path_parts):
# def save_file(content, *path_parts):
# def delete_file(*path_parts):
# def save_email(root_path, content, email_name, locale):
# def save_template(root_path, template_filename, template_type, template_content):
# def save_parsed_email(root_path, email, subject, text, html):
# def resources(root_path):
# def get_html_sections_map(root_path):


# Path: tests/test_fs.py
from unittest import TestCase
from unittest.mock import patch
from email_parser import fs
from email_parser.model import *



class MockPath(object):
    def __init__(self, path, is_dir=False, parent='.'):
        self.path = path
        self._is_dir = is_dir
        self.name = path.split('/')[-1]
        self._parent = parent
        if parent:
            self.parent = MockPath(parent, is_dir=True, parent=None)


    def is_dir(self):