示例#1
0
文件: tests.py 项目: bartdag/recodoc2
    def testJavaDiff(self):
        create_code_db('project1', 'core', '3.0')
        create_code_db('project1', 'core', '3.1')
        parse_code('project1', 'core', '3.0', 'java')
        parse_code('project1', 'core', '3.1', 'java')
        cdiff = diff_codebases('project1', 'core', '3.0', '3.1')

        self.assertEqual(4, cdiff.packages_size_from)
        self.assertEqual(5, cdiff.packages_size_to)
        self.assertEqual(1, cdiff.added_packages.count())
        self.assertEqual(0, cdiff.removed_packages.count())

        self.assertEqual(18, cdiff.types_size_from)
        self.assertEqual(19, cdiff.types_size_to)
        self.assertEqual(1, cdiff.added_types.count())
        self.assertEqual(1, cdiff.removed_types.count())

        self.assertEqual(44, cdiff.methods_size_from)
        self.assertEqual(44, cdiff.methods_size_to)
        self.assertEqual(1, cdiff.added_methods.count())
        self.assertEqual(1, cdiff.removed_methods.count())

        self.assertEqual(3, cdiff.fields_size_from)
        self.assertEqual(4, cdiff.fields_size_to)
        self.assertEqual(0, cdiff.added_fields.count())
        self.assertEqual(0, cdiff.removed_fields.count())

        self.assertEqual(6, cdiff.ann_fields_size_from)
        self.assertEqual(5, cdiff.ann_fields_size_to)
        self.assertEqual(0, cdiff.added_ann_fields.count())
        self.assertEqual(1, cdiff.removed_ann_fields.count())

        self.assertEqual(5, cdiff.enum_values_size_from)
        self.assertEqual(7, cdiff.enum_values_size_to)
        self.assertEqual(0, cdiff.added_enum_values.count())
        self.assertEqual(0, cdiff.removed_enum_values.count())
示例#2
0
    def testJavaDiff(self):
        create_code_db('project1', 'core', '3.0')
        create_code_db('project1', 'core', '3.1')
        parse_code('project1', 'core', '3.0', 'java')
        parse_code('project1', 'core', '3.1', 'java')
        cdiff = diff_codebases('project1', 'core', '3.0', '3.1')

        self.assertEqual(4, cdiff.packages_size_from)
        self.assertEqual(5, cdiff.packages_size_to)
        self.assertEqual(1, cdiff.added_packages.count())
        self.assertEqual(0, cdiff.removed_packages.count())

        self.assertEqual(18, cdiff.types_size_from)
        self.assertEqual(19, cdiff.types_size_to)
        self.assertEqual(1, cdiff.added_types.count())
        self.assertEqual(1, cdiff.removed_types.count())

        self.assertEqual(44, cdiff.methods_size_from)
        self.assertEqual(44, cdiff.methods_size_to)
        self.assertEqual(1, cdiff.added_methods.count())
        self.assertEqual(1, cdiff.removed_methods.count())

        self.assertEqual(3, cdiff.fields_size_from)
        self.assertEqual(4, cdiff.fields_size_to)
        self.assertEqual(0, cdiff.added_fields.count())
        self.assertEqual(0, cdiff.removed_fields.count())

        self.assertEqual(6, cdiff.ann_fields_size_from)
        self.assertEqual(5, cdiff.ann_fields_size_to)
        self.assertEqual(0, cdiff.added_ann_fields.count())
        self.assertEqual(1, cdiff.removed_ann_fields.count())

        self.assertEqual(5, cdiff.enum_values_size_from)
        self.assertEqual(7, cdiff.enum_values_size_to)
        self.assertEqual(0, cdiff.added_enum_values.count())
        self.assertEqual(0, cdiff.removed_enum_values.count())
示例#3
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release1 = smart_decode(options.get('release1'))
     release2 = smart_decode(options.get('release2'))
     diff_codebases(pname, bname, release1, release2)
示例#4
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release1 = smart_decode(options.get('release1'))
     release2 = smart_decode(options.get('release2'))
     diff_codebases(pname, bname, release1, release2)