Beispiel #1
0
 def test_self(self):
     reference = {
         'PythonModuleSelf': [
             'setUp', 'test_add_imported_empty',
             'test_add_imported_object_from_module',
             'test_add_imported_object_from_module_asname',
             'test_is_not_avocado_test', 'test_is_not_avocado_tests'
         ],
         'PythonModule':
         ['test_is_avocado_test', 'test_import_of_all_module_level'],
         'ModuleImportedAs': [
             '_test', 'test_foo', 'test_foo_as_bar', 'test_foo_as_foo',
             'test_import_inside_class'
         ],
         'DocstringDirectives': [
             'test_longline', 'test_newlines', 'test_enabled',
             'test_disabled', 'test_get_tags_empty', 'test_tag_single',
             'test_tag_double', 'test_tag_double_with_empty',
             'test_tag_lowercase_uppercase', 'test_tag_duplicate',
             'test_tag_tab_separator', 'test_tag_empty',
             'test_tag_newline_before', 'test_tag_newline_after',
             'test_tag_keyval_single', 'test_tag_keyval_double',
             'test_tag_keyval_duplicate', 'test_directives_regex'
         ],
         'FindClassAndMethods': [
             'test_self', 'test_with_pattern', 'test_with_base_class',
             'test_with_pattern_and_base_class', 'test_methods_order',
             'test_import_not_on_parent', 'test_recursive_discovery',
             'test_recursive_discovery_python_unittest'
         ],
         'UnlimitedDiff': ['setUp']
     }
     found = safeloader.find_class_and_methods(get_this_file())
     self.assertEqual(reference, found)
Beispiel #2
0
 def test_with_pattern(self):
     reference = {
         'ModuleImportedAs': [
             'test_foo', 'test_foo_as_bar', 'test_foo_as_foo',
             'test_import_inside_class'
         ],
         'DocstringDirectives': [
             'test_longline', 'test_newlines', 'test_enabled',
             'test_disabled', 'test_get_tags_empty', 'test_tag_single',
             'test_tag_double', 'test_tag_double_with_empty',
             'test_tag_lowercase_uppercase', 'test_tag_duplicate',
             'test_tag_tab_separator', 'test_tag_empty',
             'test_tag_newline_before', 'test_tag_newline_after',
             'test_tag_keyval_single', 'test_tag_keyval_double',
             'test_tag_keyval_duplicate', 'test_directives_regex'
         ],
         'FindClassAndMethods': [
             'test_self', 'test_with_pattern', 'test_with_base_class',
             'test_with_pattern_and_base_class', 'test_methods_order',
             'test_recursive_discovery'
         ],
         'UnlimitedDiff': []
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               re.compile(r'test.*'))
     self.assertEqual(reference, found)
Beispiel #3
0
 def test_with_pattern(self):
     reference = {
         'ModuleImportedAs': ['test_foo',
                              'test_foo_as_bar',
                              'test_foo_as_foo',
                              'test_import_inside_class'],
         'DocstringDirectives': ['test_longline',
                                 'test_newlines',
                                 'test_enabled',
                                 'test_disabled',
                                 'test_get_tags_empty',
                                 'test_tag_single',
                                 'test_tag_double',
                                 'test_tag_double_with_empty',
                                 'test_tag_lowercase_uppercase',
                                 'test_tag_duplicate',
                                 'test_tag_tab_separator',
                                 'test_tag_empty',
                                 'test_tag_newline_before',
                                 'test_tag_newline_after',
                                 'test_tag_keyval_single',
                                 'test_tag_keyval_double',
                                 'test_tag_keyval_duplicate',
                                 'test_directives_regex'],
         'FindClassAndMethods': ['test_self',
                                 'test_with_pattern',
                                 'test_with_base_class',
                                 'test_with_pattern_and_base_class',
                                 'test_methods_order',
                                 'test_recursive_discovery'],
         'UnlimitedDiff': []
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               re.compile(r'test.*'))
     self.assertEqual(reference, found)
Beispiel #4
0
 def test_with_base_class(self):
     reference = {
         'FindClassAndMethods': [
             'test_self', 'test_with_pattern', 'test_with_base_class',
             'test_with_pattern_and_base_class'
         ],
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               base_class='UnlimitedDiff')
     self.assertEqual(reference, found)
 def test_with_pattern_and_base_class(self):
     reference = {
         'FindClassAndMethods': ['test_with_pattern',
                                 'test_with_base_class',
                                 'test_with_pattern_and_base_class']
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               re.compile(r'test_with.*'),
                                               'UnlimitedDiff')
     self.assertEqual(reference, found)
Beispiel #6
0
 def test_with_base_class(self):
     reference = {
         'FindClassAndMethods': [
             'test_self', 'test_with_pattern', 'test_with_base_class',
             'test_with_pattern_and_base_class', 'test_methods_order',
             'test_import_not_on_parent', 'test_recursive_discovery',
             'test_recursive_discovery_python_unittest'
         ],
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               base_class='UnlimitedDiff')
     self.assertEqual(reference, found)
 def test_with_base_class(self):
     reference = {
         'FindClassAndMethods': ['test_self',
                                 'test_with_pattern',
                                 'test_with_base_class',
                                 'test_with_pattern_and_base_class',
                                 'test_methods_order',
                                 'test_recursive_discovery'],
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               base_class='UnlimitedDiff')
     self.assertEqual(reference, found)
 def test_self(self):
     reference = {
         'ModuleImportedAs': [
             '_test', 'test_foo', 'test_foo_as_bar', 'test_foo_as_foo',
             'test_import_inside_class'
         ],
         'DocstringDirectives': [
             'test_longline', 'test_newlines', 'test_enabled',
             'test_disabled', 'test_get_tags_empty', 'test_get_tags'
         ],
         'FindClassAndMethods': [
             'test_self', 'test_with_pattern', 'test_with_base_class',
             'test_with_pattern_and_base_class'
         ],
         'UnlimitedDiff': ['setUp']
     }
     found = safeloader.find_class_and_methods(get_this_file())
     self.assertEqual(reference, found)
 def test_self(self):
     reference = {
         'PythonModuleSelf': ['setUp',
                              'test_add_imported_empty',
                              'test_add_imported_object_from_module',
                              'test_add_imported_object_from_module_asname',
                              'test_is_not_avocado_test',
                              'test_is_not_avocado_tests'],
         'PythonModule': ['test_is_avocado_test',
                          'test_import_of_all_module_level'],
         'ModuleImportedAs': ['_test',
                              'test_foo',
                              'test_foo_as_bar',
                              'test_foo_as_foo',
                              'test_import_inside_class'],
         'DocstringDirectives': ['test_longline',
                                 'test_newlines',
                                 'test_enabled',
                                 'test_disabled',
                                 'test_get_tags_empty',
                                 'test_tag_single',
                                 'test_tag_double',
                                 'test_tag_double_with_empty',
                                 'test_tag_lowercase_uppercase',
                                 'test_tag_duplicate',
                                 'test_tag_tab_separator',
                                 'test_tag_empty',
                                 'test_tag_newline_before',
                                 'test_tag_newline_after',
                                 'test_tag_keyval_single',
                                 'test_tag_keyval_double',
                                 'test_tag_keyval_duplicate',
                                 'test_directives_regex'],
         'FindClassAndMethods': ['test_self',
                                 'test_with_pattern',
                                 'test_with_base_class',
                                 'test_with_pattern_and_base_class',
                                 'test_methods_order',
                                 'test_recursive_discovery'],
         'UnlimitedDiff': ['setUp']
     }
     found = safeloader.find_class_and_methods(get_this_file())
     self.assertEqual(reference, found)
Beispiel #10
0
 def test_self(self):
     reference = {
         'ModuleImportedAs': ['_test',
                              'test_foo',
                              'test_foo_as_bar',
                              'test_foo_as_foo',
                              'test_import_inside_class'],
         'DocstringTag': ['test_longline',
                          'test_newlines',
                          'test_enabled',
                          'test_disabled'],
         'FindClassAndMethods': ['test_self',
                                 'test_with_pattern',
                                 'test_with_base_class',
                                 'test_with_pattern_and_base_class'],
         'UnlimitedDiff': ['setUp']
     }
     found = safeloader.find_class_and_methods(get_this_file())
     self.assertEqual(reference, found)
Beispiel #11
0
 def test_with_pattern(self):
     reference = {
         'ModuleImportedAs': [
             'test_foo', 'test_foo_as_bar', 'test_foo_as_foo',
             'test_import_inside_class'
         ],
         'DocstringTag': [
             'test_longline', 'test_newlines', 'test_enabled',
             'test_disabled'
         ],
         'FindClassAndMethods': [
             'test_self', 'test_with_pattern', 'test_with_base_class',
             'test_with_pattern_and_base_class'
         ],
         'UnlimitedDiff': []
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               re.compile(r'test.*'))
     self.assertEqual(reference, found)
Beispiel #12
0
 def test_with_pattern(self):
     reference = {
         'ModuleImportedAs': ['test_foo',
                              'test_foo_as_bar',
                              'test_foo_as_foo',
                              'test_import_inside_class'],
         'DocstringDirectives': ['test_longline',
                                 'test_newlines',
                                 'test_enabled',
                                 'test_disabled',
                                 'test_is_tags',
                                 'test_get_tags_empty',
                                 'test_get_tags'],
         'FindClassAndMethods': ['test_self',
                                 'test_with_pattern',
                                 'test_with_base_class',
                                 'test_with_pattern_and_base_class'],
         'UnlimitedDiff': []
     }
     found = safeloader.find_class_and_methods(get_this_file(),
                                               re.compile(r'test.*'))
     self.assertEqual(reference, found)