# Path: mistletoe/block_token.py
# def tokenize(lines):
# def add_token(token_cls, position=0):
# def remove_token(token_cls):
# def reset_tokens():
#     def __init__(self, lines, tokenize_func):
#     def __contains__(self, text):
#     def read(lines):
#     def __init__(self, lines):
#     def __init__(self, match):
#     def start(cls, line):
#     def read(cls, lines):
#     def __init__(self, lines):
#     def start(cls, line):
#     def read(cls, lines):
#     def __init__(self, parse_buffer):
#     def start(line):
#     def read(cls, lines):
#     def convert_leading_tabs(string):
#     def __new__(cls, lines):
#     def __init__(self, lines):
#     def start(line):
#     def read(cls, lines):
#     def is_setext_heading(cls, line):
#     def __init__(self, lines):
#     def start(line):
#     def read(cls, lines):
#     def strip(string):
#     def __init__(self, match):
#     def start(cls, line):
#     def read(cls, lines):
#     def __init__(self, matches):
#     def start(cls, line):
#     def read(cls, lines):
#     def same_marker_type(leader, other):
#     def __init__(self, parse_buffer, prepend, leader):
#     def in_continuation(line, prepend):
#     def other_token(line):
#     def parse_marker(cls, line):
#     def read(cls, lines, prev_marker=None):
#     def __init__(self, lines):
#     def split_delimiter(delimiter):
#     def parse_align(column):
#     def start(line):
#     def read(lines):
#     def __init__(self, line, row_align=None):
#     def __init__(self, content, align=None):
#     def __new__(cls, _):
#     def start(cls, line):
#     def read(cls, lines):
#     def match_reference(cls, lines, string, offset):
#     def match_link_label(cls, string, offset):
#     def match_link_dest(cls, string, offset):
#     def match_link_title(cls, string, offset):
#     def append_footnotes(matches, root):
#     def backtrack(lines, string, offset):
#     def __init__(self, _):
#     def start(cls, line):
#     def read(lines):
#     def __init__(self, lines):
#     def start(cls, line):
#     def read(cls, lines):
# class BlockToken(object):
# class Document(BlockToken):
# class Heading(BlockToken):
# class SetextHeading(BlockToken):
# class Quote(BlockToken):
# class Paragraph(BlockToken):
# class BlockCode(BlockToken):
# class CodeFence(BlockToken):
# class List(BlockToken):
# class ListItem(BlockToken):
# class Table(BlockToken):
# class TableRow(BlockToken):
# class TableCell(BlockToken):
# class Footnote(BlockToken):
# class ThematicBreak(BlockToken):
# class HTMLBlock(BlockToken):
# 
# Path: mistletoe/span_token.py
# def tokenize_inner(content):
# def add_token(token_cls, position=1):
# def remove_token(token_cls):
# def reset_tokens():
#     def __init__(self, match):
#     def __contains__(self, text):
#     def find(cls, string):
#     def __new__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def strip(cls, string):
#     def __init__(self, match):
#     def __init__(self, content):
# class SpanToken:
# class CoreTokens(SpanToken):
# class Strong(SpanToken):
# class Emphasis(SpanToken):
# class InlineCode(SpanToken):
# class Strikethrough(SpanToken):
# class Image(SpanToken):
# class Link(SpanToken):
# class AutoLink(SpanToken):
# class EscapeSequence(SpanToken):
# class LineBreak(SpanToken):
# class RawText(SpanToken):
# class HTMLSpan(SpanToken):
# class XWikiBlockMacroStart(SpanToken):
# class XWikiBlockMacroEnd(SpanToken):
# 
# Path: mistletoe/block_tokenizer.py
# class FileWrapper:
#     def __init__(self, lines):
#         self.lines = lines if isinstance(lines, list) else list(lines)
#         self._index = -1
#         self._anchor = 0
# 
#     def __next__(self):
#         if self._index + 1 < len(self.lines):
#             self._index += 1
#             return self.lines[self._index]
#         raise StopIteration
# 
#     def __iter__(self):
#         return self
# 
#     def __repr__(self):
#         return repr(self.lines[self._index+1:])
# 
#     def anchor(self):
#         self._anchor = self._index
# 
#     def reset(self):
#         self._index = self._anchor
# 
#     def peek(self):
#         if self._index + 1 < len(self.lines):
#             return self.lines[self._index+1]
#         return None
# 
#     def backstep(self):
#         if self._index != -1:
#             self._index -= 1


import unittest
from unittest.mock import patch, call
from mistletoe import block_token, span_token
from mistletoe.block_tokenizer import FileWrapper


class TestToken(unittest.TestCase):
    def setUp(self):
        self.addCleanup(lambda: span_token._token_types.__setitem__(-1, span_token.RawText))
        patcher = patch('mistletoe.span_token.RawText')
        self.mock = patcher.start()
        span_token._token_types[-1] = self.mock
        self.addCleanup(patcher.stop)

    def _test_match(self, token_cls, lines, arg, **kwargs):

# Path: mistletoe/block_token.py
# def tokenize(lines):
# def add_token(token_cls, position=0):
# def remove_token(token_cls):
# def reset_tokens():
#     def __init__(self, lines, tokenize_func):
#     def __contains__(self, text):
#     def read(lines):
#     def __init__(self, lines):
#     def __init__(self, match):
#     def start(cls, line):
#     def read(cls, lines):
#     def __init__(self, lines):
#     def start(cls, line):
#     def read(cls, lines):
#     def __init__(self, parse_buffer):
#     def start(line):
#     def read(cls, lines):
#     def convert_leading_tabs(string):
#     def __new__(cls, lines):
#     def __init__(self, lines):
#     def start(line):
#     def read(cls, lines):
#     def is_setext_heading(cls, line):
#     def __init__(self, lines):
#     def start(line):
#     def read(cls, lines):
#     def strip(string):
#     def __init__(self, match):
#     def start(cls, line):
#     def read(cls, lines):
#     def __init__(self, matches):
#     def start(cls, line):
#     def read(cls, lines):
#     def same_marker_type(leader, other):
#     def __init__(self, parse_buffer, prepend, leader):
#     def in_continuation(line, prepend):
#     def other_token(line):
#     def parse_marker(cls, line):
#     def read(cls, lines, prev_marker=None):
#     def __init__(self, lines):
#     def split_delimiter(delimiter):
#     def parse_align(column):
#     def start(line):
#     def read(lines):
#     def __init__(self, line, row_align=None):
#     def __init__(self, content, align=None):
#     def __new__(cls, _):
#     def start(cls, line):
#     def read(cls, lines):
#     def match_reference(cls, lines, string, offset):
#     def match_link_label(cls, string, offset):
#     def match_link_dest(cls, string, offset):
#     def match_link_title(cls, string, offset):
#     def append_footnotes(matches, root):
#     def backtrack(lines, string, offset):
#     def __init__(self, _):
#     def start(cls, line):
#     def read(lines):
#     def __init__(self, lines):
#     def start(cls, line):
#     def read(cls, lines):
# class BlockToken(object):
# class Document(BlockToken):
# class Heading(BlockToken):
# class SetextHeading(BlockToken):
# class Quote(BlockToken):
# class Paragraph(BlockToken):
# class BlockCode(BlockToken):
# class CodeFence(BlockToken):
# class List(BlockToken):
# class ListItem(BlockToken):
# class Table(BlockToken):
# class TableRow(BlockToken):
# class TableCell(BlockToken):
# class Footnote(BlockToken):
# class ThematicBreak(BlockToken):
# class HTMLBlock(BlockToken):
# 
# Path: mistletoe/span_token.py
# def tokenize_inner(content):
# def add_token(token_cls, position=1):
# def remove_token(token_cls):
# def reset_tokens():
#     def __init__(self, match):
#     def __contains__(self, text):
#     def find(cls, string):
#     def __new__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def find(cls, string):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def __init__(self, match):
#     def strip(cls, string):
#     def __init__(self, match):
#     def __init__(self, content):
# class SpanToken:
# class CoreTokens(SpanToken):
# class Strong(SpanToken):
# class Emphasis(SpanToken):
# class InlineCode(SpanToken):
# class Strikethrough(SpanToken):
# class Image(SpanToken):
# class Link(SpanToken):
# class AutoLink(SpanToken):
# class EscapeSequence(SpanToken):
# class LineBreak(SpanToken):
# class RawText(SpanToken):
# class HTMLSpan(SpanToken):
# class XWikiBlockMacroStart(SpanToken):
# class XWikiBlockMacroEnd(SpanToken):
# 
# Path: mistletoe/block_tokenizer.py
# class FileWrapper:
#     def __init__(self, lines):
#         self.lines = lines if isinstance(lines, list) else list(lines)
#         self._index = -1
#         self._anchor = 0
# 
#     def __next__(self):
#         if self._index + 1 < len(self.lines):
#             self._index += 1
#             return self.lines[self._index]
#         raise StopIteration
# 
#     def __iter__(self):
#         return self
# 
#     def __repr__(self):
#         return repr(self.lines[self._index+1:])
# 
#     def anchor(self):
#         self._anchor = self._index
# 
#     def reset(self):
#         self._index = self._anchor
# 
#     def peek(self):
#         if self._index + 1 < len(self.lines):
#             return self.lines[self._index+1]
#         return None
# 
#     def backstep(self):
#         if self._index != -1:
#             self._index -= 1


# Path: test/test_block_token.py
import unittest
from unittest.mock import patch, call
from mistletoe import block_token, span_token
from mistletoe.block_tokenizer import FileWrapper



class TestToken(unittest.TestCase):
    def setUp(self):
        self.addCleanup(lambda: span_token._token_types.__setitem__(-1, span_token.RawText))
        patcher = patch('mistletoe.span_token.RawText')
        self.mock = patcher.start()
        span_token._token_types[-1] = self.mock
        self.addCleanup(patcher.stop)

    def _test_match(self, token_cls, lines, arg, **kwargs):

        token = next(iter(block_token.tokenize(lines)))