def test_package_report_generator_without_vendor_string(self):
        class VersionObj(object):
            def product_string(self):
                return 'Sharp Cheddar'

            def version_string_with_package(self):
                return '1.0.0'

        model = os_pgen.PackageReportGenerator(VersionObj())()
        model.set_current_view_type('text')

        target_str = ('product = Sharp Cheddar\n'
                      'vendor = None\n'
                      'version = 1.0.0')
        self.assertEqual(target_str, six.text_type(model))
Beispiel #2
0
    def _readd_sections(self):
        del self.sections[self.start_section_index:]

        self.add_section('Package',
                         pgen.PackageReportGenerator(self.version_obj))

        self.add_section('Threads', tgen.ThreadReportGenerator(self.traceback))

        self.add_section('Green Threads', tgen.GreenThreadReportGenerator())

        self.add_section('Processes', prgen.ProcessReportGenerator())

        self.add_section('Configuration', cgen.ConfigReportGenerator())

        try:
            for section_title, generator in self.persistent_sections:
                self.add_section(section_title, generator)
        except AttributeError:
            pass