# Path: android_env/components/log_stream.py
# class LogStream(metaclass=abc.ABCMeta):
#   def __init__(self, verbose: bool = False):
#   def get_stream_output(self):
#   def _get_stream_output(self):
#   def stop_stream(self):
#   def set_log_filters(self, log_filters: List[str]):
# 
# Path: android_env/components/logcat_thread.py
# class EventListener(NamedTuple):
# class LogcatThread(thread_function.ThreadFunction):
#   def __init__(
#       self,
#       log_stream: log_stream_lib.LogStream,
#       log_parsing_config: task_pb2.LogParsingConfig,
#       name: str = 'logcat'):
#   def add_event_listener(self, event_listener: EventListener) -> None:
#   def remove_event_listener(self, event_listener: EventListener) -> None:
#   def wait(self,
#            event: Optional[Pattern[str]] = None,
#            timeout_sec: Optional[float] = None) -> None:
#   def kill(self):
#   def main(self) -> None:


import re
import threading
from typing import Match, Pattern
from absl.testing import absltest
from android_env.components import log_stream
from android_env.components import logcat_thread
from android_env.proto import task_pb2


class FakeLogStream(log_stream.LogStream):
  """Add doc string."""

  def __init__(self):
    self.logs = FakeStream()
    self.stream_is_alive = True
    self._verbose = False

  def _get_stream_output(self):
    return self.logs

  def stop_stream(self):
    self.stream_is_alive = False
    self.logs.kill()


class LogcatThreadTest(absltest.TestCase):

  def setUp(self):
    super().setUp()
    self.fake_log_stream = FakeLogStream()

  def tearDown(self):
    self.fake_log_stream.stop_stream()
    super().tearDown()

  def test_set_filters(self):
    _ = logcat_thread.LogcatThread(

# Path: android_env/components/log_stream.py
# class LogStream(metaclass=abc.ABCMeta):
#   def __init__(self, verbose: bool = False):
#   def get_stream_output(self):
#   def _get_stream_output(self):
#   def stop_stream(self):
#   def set_log_filters(self, log_filters: List[str]):
# 
# Path: android_env/components/logcat_thread.py
# class EventListener(NamedTuple):
# class LogcatThread(thread_function.ThreadFunction):
#   def __init__(
#       self,
#       log_stream: log_stream_lib.LogStream,
#       log_parsing_config: task_pb2.LogParsingConfig,
#       name: str = 'logcat'):
#   def add_event_listener(self, event_listener: EventListener) -> None:
#   def remove_event_listener(self, event_listener: EventListener) -> None:
#   def wait(self,
#            event: Optional[Pattern[str]] = None,
#            timeout_sec: Optional[float] = None) -> None:
#   def kill(self):
#   def main(self) -> None:


# Path: android_env/components/logcat_thread_test.py
import re
import threading
from typing import Match, Pattern
from absl.testing import absltest
from android_env.components import log_stream
from android_env.components import logcat_thread
from android_env.proto import task_pb2



class FakeLogStream(log_stream.LogStream):
  """Add doc string."""

  def __init__(self):
    self.logs = FakeStream()
    self.stream_is_alive = True
    self._verbose = False

  def _get_stream_output(self):
    return self.logs

  def stop_stream(self):
    self.stream_is_alive = False
    self.logs.kill()


class LogcatThreadTest(absltest.TestCase):

  def setUp(self):
    super().setUp()
    self.fake_log_stream = FakeLogStream()

  def tearDown(self):
    self.fake_log_stream.stop_stream()
    super().tearDown()

  def test_set_filters(self):
    _ = logcat_thread.LogcatThread(

        log_stream=self.fake_log_stream,