# Path: sampletester/parser.py
# SCHEMA_TYPE_KEY = 'type'
# SCHEMA_TYPE_ABSENT = '(no type)' # for indexing docs with no SCHEMA_TYPE_KEY
# SCHEMA_TYPE_SEPARATOR = '/'
# SCHEMA_VERSION_KEY = 'schema_version'
# class SchemaDescriptor:
# class IndexedDocs(object):
# class YamlDocSyntaxError(Exception):
#   def __post_init__(self) -> str:
#   def has_version(self) -> bool:
#   def __init__(self,
#                strict: bool = False,
#                resolver: Callable[[Document], str] = None):
#   def contains(self, *type_names: str) -> bool:
#   def from_files(self, *paths: str):
#   def from_strings(self, *sources: Tuple[str, str]):
#   def add(self, content:str, file_name: str):
#   def add_documents(self, *documents: Document):
#   def of_type(self, type_name: str) -> List[Document]:
#   def resolve_uncategorized(self):
# def only_files_in(paths: Iterable[str]) -> Set[str]:
# 
# Path: sampletester/testplan.py
# class Wrapper:
# class Environment(Wrapper):
# class Suite(Wrapper):
# class TestCase(Wrapper):
# class Visitor:
# class MultiVisitor(Visitor):
# class Manager:
#   def __init__(self):
#   def update_times(self, starting, ending):
#   def duration(self):
#   def success(self):
#   def selected(self):
#   def __init__(self, env_config, test_suites, env_filter):
#   def name(self):
#   def __init__(self, suite_config, suite_filter, case_filter):
#   def selected(self):
#   def enabled(self):
#   def setup(self):
#   def teardown(self):
#   def name(self):
#   def source(self):
#   def __repr__(self):
#   def __init__(self, test_config, case_filter):
#   def name(self):
#   def spec(self):
#   def __repr__(self):
# def passes_filter(filter: str, name: str):
#   def start_visit(self):
#   def visit_environment(self, environment: Environment, doit: bool):
#   def visit_suite(self, idx: int, suite: Suite, doit: bool):
#   def visit_testcase(self, idx: int, testcase: TestCase, doit: bool):
#   def visit_suite_end(self, idx: int, suite: Suite, doit: bool):
#   def visit_environment_end(self, environment: Environment, doit: bool):
#   def end_visit(self):
#   def __init__(self, *visitors: Visitor):
#   def start_visit(self):
#   def visit_environment(self, environment: Environment, doit: bool, visit_fns):
#   def visit_suite(self, idx: int, suite: Suite, doit: bool, visit_fns):
#   def visit_testcase(self, idx: int, testcase: TestCase, doit: bool,
#                      visit_fns):
#   def visit_suite_end(self, idx: int, suite: Suite, doit: bool, visit_fns):
#   def visit_environment_end(self, environment: Environment, doit: bool,
#                             visit_fns):
#   def end_visit(self):
#   def __init__(self, environment_registry, test_suites, env_filter:str = None):
#   def accept(self, visitor: Visitor):
# def suite_configs_from(test_docs: List[parser.Document]) -> List[object]:
# def suites_from_doc_list(test_docs: List[parser.Document],
#                          suite_filter: str = None,
#                          case_filter: str = None) -> List[Suite]:
# def suites_from(indexed_docs: parser.IndexedDocs,
#                 suite_filter: str = None,
#                 case_filter: str = None) -> List[Suite]:
# SUITE_ENABLED = "enabled"
# SUITE_SETUP = "setup"
# SUITE_TEARDOWN = "teardown"
# SUITE_NAME = "name"
# SUITE_SOURCE = "source"
# SUITE_CASES = "cases"
# CASE_NAME = "name"
# CASE_SPEC = "spec"
# SCHEMA = parser.SchemaDescriptor('test','samples', 1)


import unittest
from textwrap import dedent
from sampletester import parser
from sampletester import testplan
    selected_cases = {test_case.name()
                      for suite in test_plan
                      for test_case in suite.cases
                      if suite.selected() and test_case.selected()}
    self.assertEqual({'hadrons', 'leptons'}, selected_suites)
    self.assertEqual({'proton', 'neutron', 'electron', 'muon','tauon'}, selected_cases)

  def test_suites_from_filter_suites(self):
    test_plan = testplan.suites_from(self.config, suite_filter='adr')

    selected_suites = {suite.name() for suite in test_plan if suite.selected()}
    selected_cases = {test_case.name()
                      for suite in test_plan
                      for test_case in suite.cases
                      if suite.selected() and test_case.selected()}
    self.assertEqual({'hadrons'}, selected_suites)
    self.assertEqual({'proton', 'neutron'}, selected_cases)

  def test_suites_from_filter_cases(self):
    test_plan = testplan.suites_from(self.config, case_filter='tron')

    selected_suites = {suite.name() for suite in test_plan if suite.selected()}
    selected_cases = {test_case.name()
                      for suite in test_plan
                      for test_case in suite.cases
                      if suite.selected() and test_case.selected()}
    self.assertEqual({'hadrons', 'leptons'}, selected_suites)
    self.assertEqual({'neutron', 'electron'}, selected_cases)

  def test_suites_from_filter_suites_and_cases(self):

# Path: sampletester/parser.py
# SCHEMA_TYPE_KEY = 'type'
# SCHEMA_TYPE_ABSENT = '(no type)' # for indexing docs with no SCHEMA_TYPE_KEY
# SCHEMA_TYPE_SEPARATOR = '/'
# SCHEMA_VERSION_KEY = 'schema_version'
# class SchemaDescriptor:
# class IndexedDocs(object):
# class YamlDocSyntaxError(Exception):
#   def __post_init__(self) -> str:
#   def has_version(self) -> bool:
#   def __init__(self,
#                strict: bool = False,
#                resolver: Callable[[Document], str] = None):
#   def contains(self, *type_names: str) -> bool:
#   def from_files(self, *paths: str):
#   def from_strings(self, *sources: Tuple[str, str]):
#   def add(self, content:str, file_name: str):
#   def add_documents(self, *documents: Document):
#   def of_type(self, type_name: str) -> List[Document]:
#   def resolve_uncategorized(self):
# def only_files_in(paths: Iterable[str]) -> Set[str]:
# 
# Path: sampletester/testplan.py
# class Wrapper:
# class Environment(Wrapper):
# class Suite(Wrapper):
# class TestCase(Wrapper):
# class Visitor:
# class MultiVisitor(Visitor):
# class Manager:
#   def __init__(self):
#   def update_times(self, starting, ending):
#   def duration(self):
#   def success(self):
#   def selected(self):
#   def __init__(self, env_config, test_suites, env_filter):
#   def name(self):
#   def __init__(self, suite_config, suite_filter, case_filter):
#   def selected(self):
#   def enabled(self):
#   def setup(self):
#   def teardown(self):
#   def name(self):
#   def source(self):
#   def __repr__(self):
#   def __init__(self, test_config, case_filter):
#   def name(self):
#   def spec(self):
#   def __repr__(self):
# def passes_filter(filter: str, name: str):
#   def start_visit(self):
#   def visit_environment(self, environment: Environment, doit: bool):
#   def visit_suite(self, idx: int, suite: Suite, doit: bool):
#   def visit_testcase(self, idx: int, testcase: TestCase, doit: bool):
#   def visit_suite_end(self, idx: int, suite: Suite, doit: bool):
#   def visit_environment_end(self, environment: Environment, doit: bool):
#   def end_visit(self):
#   def __init__(self, *visitors: Visitor):
#   def start_visit(self):
#   def visit_environment(self, environment: Environment, doit: bool, visit_fns):
#   def visit_suite(self, idx: int, suite: Suite, doit: bool, visit_fns):
#   def visit_testcase(self, idx: int, testcase: TestCase, doit: bool,
#                      visit_fns):
#   def visit_suite_end(self, idx: int, suite: Suite, doit: bool, visit_fns):
#   def visit_environment_end(self, environment: Environment, doit: bool,
#                             visit_fns):
#   def end_visit(self):
#   def __init__(self, environment_registry, test_suites, env_filter:str = None):
#   def accept(self, visitor: Visitor):
# def suite_configs_from(test_docs: List[parser.Document]) -> List[object]:
# def suites_from_doc_list(test_docs: List[parser.Document],
#                          suite_filter: str = None,
#                          case_filter: str = None) -> List[Suite]:
# def suites_from(indexed_docs: parser.IndexedDocs,
#                 suite_filter: str = None,
#                 case_filter: str = None) -> List[Suite]:
# SUITE_ENABLED = "enabled"
# SUITE_SETUP = "setup"
# SUITE_TEARDOWN = "teardown"
# SUITE_NAME = "name"
# SUITE_SOURCE = "source"
# SUITE_CASES = "cases"
# CASE_NAME = "name"
# CASE_SPEC = "spec"
# SCHEMA = parser.SchemaDescriptor('test','samples', 1)


# Path: tests/testplan_test.py
import unittest
from textwrap import dedent
from sampletester import parser
from sampletester import testplan

    selected_cases = {test_case.name()
                      for suite in test_plan
                      for test_case in suite.cases
                      if suite.selected() and test_case.selected()}
    self.assertEqual({'hadrons', 'leptons'}, selected_suites)
    self.assertEqual({'proton', 'neutron', 'electron', 'muon','tauon'}, selected_cases)

  def test_suites_from_filter_suites(self):
    test_plan = testplan.suites_from(self.config, suite_filter='adr')

    selected_suites = {suite.name() for suite in test_plan if suite.selected()}
    selected_cases = {test_case.name()
                      for suite in test_plan
                      for test_case in suite.cases
                      if suite.selected() and test_case.selected()}
    self.assertEqual({'hadrons'}, selected_suites)
    self.assertEqual({'proton', 'neutron'}, selected_cases)

  def test_suites_from_filter_cases(self):
    test_plan = testplan.suites_from(self.config, case_filter='tron')

    selected_suites = {suite.name() for suite in test_plan if suite.selected()}
    selected_cases = {test_case.name()
                      for suite in test_plan
                      for test_case in suite.cases
                      if suite.selected() and test_case.selected()}
    self.assertEqual({'hadrons', 'leptons'}, selected_suites)
    self.assertEqual({'neutron', 'electron'}, selected_cases)

  def test_suites_from_filter_suites_and_cases(self):

    test_plan = testplan.suites_from(self.config, suite_filter='adr', case_filter='tron')