示例#1
0
    def test_detect_api_mismatch(self):
        missing_items = support.detect_api_mismatch(self.RefClass,
                                                    self.OtherClass)
        self.assertEqual({'attribute1'}, missing_items)

        missing_items = support.detect_api_mismatch(self.OtherClass,
                                                    self.RefClass)
        self.assertEqual({'attribute3', '__magic_2__'}, missing_items)
示例#2
0
    def test_detect_api_mismatch__ignore(self):
        ignore = ["attribute1", "attribute3", "__magic_2__", "not_in_either"]

        missing_items = support.detect_api_mismatch(self.RefClass, self.OtherClass, ignore=ignore)
        self.assertEqual(set(), missing_items)

        missing_items = support.detect_api_mismatch(self.OtherClass, self.RefClass, ignore=ignore)
        self.assertEqual(set(), missing_items)
示例#3
0
    def test_detect_api_mismatch__ignore(self):
        ignore = ['attribute1', 'attribute3', '__magic_2__', 'not_in_either']

        missing_items = support.detect_api_mismatch(
                self.RefClass, self.OtherClass, ignore=ignore)
        self.assertEqual(set(), missing_items)

        missing_items = support.detect_api_mismatch(
                self.OtherClass, self.RefClass, ignore=ignore)
        self.assertEqual(set(), missing_items)
示例#4
0
    def test_detect_api_mismatch__ignore(self):
        ignore = ['attribute1', 'attribute3', '__magic_2__', 'not_in_either']

        missing_items = support.detect_api_mismatch(self.RefClass,
                                                    self.OtherClass,
                                                    ignore=ignore)
        self.assertEqual(set(), missing_items)

        missing_items = support.detect_api_mismatch(self.OtherClass,
                                                    self.RefClass,
                                                    ignore=ignore)
        self.assertEqual(set(), missing_items)