# Path: tests/Mocks.py
# class SubtitleMock:
#     def __init__(self, start = None, end = None, text = None):
#         self.start = start
#         self.end = end
#         self.text = text
#         self.fps = start.fps if start is not None else None
# 
#     def __eq__(self, other):
#         return self.text == other.text
# 
#     def __ne__(self, other):
#         return self.text != other.text
# 
#     def change(self, start = None, end = None, text = None):
#         if start is not None:
#             self.start = start
#         if end is not None:
#             self.end = end
#         if text is not None:
#             self.text = text
# 
#     def clone(self):
#         return self


import unittest
from subconvert.utils.SubtitleSearch import *
from tests.Mocks import SubtitleMock
This file is part of Subconvert

Subconvert is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Subconvert is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Subconvert. If not, see <http://www.gnu.org/licenses/>.
"""


def abcMatcher(sub):
    return "abc" in sub.text

class TestSubtitleSearch(unittest.TestCase):
    """SubtitleSearch test suite."""

    # for matchText tests
    sub = SubtitleMock(text = "zażółć Gęślą jaźń")

    # for SearchIterator tests
    subs = [
        SubtitleMock(text = "abc1"),
        SubtitleMock(text = "nothing"),

# Path: tests/Mocks.py
# class SubtitleMock:
#     def __init__(self, start = None, end = None, text = None):
#         self.start = start
#         self.end = end
#         self.text = text
#         self.fps = start.fps if start is not None else None
# 
#     def __eq__(self, other):
#         return self.text == other.text
# 
#     def __ne__(self, other):
#         return self.text != other.text
# 
#     def change(self, start = None, end = None, text = None):
#         if start is not None:
#             self.start = start
#         if end is not None:
#             self.end = end
#         if text is not None:
#             self.text = text
# 
#     def clone(self):
#         return self


# Path: tests/test_SubtitleSearch.py
import unittest
from subconvert.utils.SubtitleSearch import *
from tests.Mocks import SubtitleMock

This file is part of Subconvert

Subconvert is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Subconvert is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Subconvert. If not, see <http://www.gnu.org/licenses/>.
"""


def abcMatcher(sub):
    return "abc" in sub.text

class TestSubtitleSearch(unittest.TestCase):
    """SubtitleSearch test suite."""

    # for matchText tests
    sub = SubtitleMock(text = "zażółć Gęślą jaźń")

    # for SearchIterator tests
    subs = [
        SubtitleMock(text = "abc1"),
        SubtitleMock(text = "nothing"),

        SubtitleMock(text = "abc2"),