Пример #1
0
 def __init__(self, parent):
     _Table.__init__(self, parent)
     self.doc = Documentation('Documentation', self)
     self.suite_setup = Fixture('Suite Setup', self)
     self.suite_teardown = Fixture('Suite Teardown', self)
     self.test_setup = Fixture('Test Setup', self)
     self.test_teardown = Fixture('Test Teardown', self)
     self.force_tags = Tags('Force Tags', self)
     self.default_tags = Tags('Default Tags', self)
     self.test_template = Template('Test Template', self)
     self.test_timeout = Timeout('Test Timeout', self)
     self.metadata = MetadataList(self)
     self.imports = ImportList(self)
Пример #2
0
class _SettingTable(_Table, _WithSettings):
    type = 'setting'

    def __init__(self, parent):
        _Table.__init__(self, parent)
        self.doc = Documentation('Documentation', self)
        self.suite_setup = Fixture('Suite Setup', self)
        self.suite_teardown = Fixture('Suite Teardown', self)
        self.test_setup = Fixture('Test Setup', self)
        self.test_teardown = Fixture('Test Teardown', self)
        self.force_tags = Tags('Force Tags', self)
        self.default_tags = Tags('Default Tags', self)
        self.test_template = Template('Test Template', self)
        self.test_timeout = Timeout('Test Timeout', self)
        self.metadata = MetadataList(self)
        self.imports = ImportList(self)

    @property
    def _old_header_matcher(self):
        return OldStyleSettingAndVariableTableHeaderMatcher()

    def add_metadata(self, name, value='', comment=None):
        self.metadata.add(
            Metadata(self, name, value, comment, linenumber=self.linenumber))
        return self.metadata[-1]

    def add_library(self, name, args=None, comment=None):
        self.imports.add(Library(self, name, args, comment=comment))
        return self.imports[-1]

    def add_resource(self, name, invalid_args=None, comment=None):
        self.imports.add(Resource(self, name, invalid_args, comment=comment))
        return self.imports[-1]

    def add_variables(self, name, args=None, comment=None):
        self.imports.add(Variables(self, name, args, comment=comment))
        return self.imports[-1]

    def __len__(self):
        return sum(1 for setting in self if setting.is_set())
Пример #3
0
 def __init__(self, parent):
     _Table.__init__(self, parent)
     self.doc = Documentation('Documentation', self)
     self.suite_setup = Fixture('Suite Setup', self)
     self.suite_teardown = Fixture('Suite Teardown', self)
     self.test_setup = Fixture('Test Setup', self)
     self.test_teardown = Fixture('Test Teardown', self)
     self.force_tags = Tags('Force Tags', self)
     self.default_tags = Tags('Default Tags', self)
     self.test_template = Template('Test Template', self)
     self.test_timeout = Timeout('Test Timeout', self)
     self.metadata = MetadataList(self)
     self.imports = ImportList(self)
Пример #4
0
class _SettingTable(_Table, _WithSettings):
    type = 'setting'

    def __init__(self, parent):
        _Table.__init__(self, parent)
        self.doc = Documentation('Documentation', self)
        self.suite_setup = Fixture('Suite Setup', self)
        self.suite_teardown = Fixture('Suite Teardown', self)
        self.test_setup = Fixture('Test Setup', self)
        self.test_teardown = Fixture('Test Teardown', self)
        self.force_tags = Tags('Force Tags', self)
        self.default_tags = Tags('Default Tags', self)
        self.test_template = Template('Test Template', self)
        self.test_timeout = Timeout('Test Timeout', self)
        self.metadata = MetadataList(self)
        self.imports = ImportList(self)

    @property
    def _old_header_matcher(self):
        return OldStyleSettingAndVariableTableHeaderMatcher()

    def add_metadata(self, name, value='', comment=None):
        self.metadata.add(Metadata(self, name, value, comment))
        return self.metadata[-1]

    def add_library(self, name, args=None, comment=None):
        self.imports.add(Library(self, name, args, comment=comment))
        return self.imports[-1]

    def add_resource(self, name, invalid_args=None, comment=None):
        self.imports.add(Resource(self, name, invalid_args, comment=comment))
        return self.imports[-1]

    def add_variables(self, name, args=None, comment=None):
        self.imports.add(Variables(self, name, args, comment=comment))
        return self.imports[-1]

    def __len__(self):
        return sum(1 for setting in self if setting.is_set())