Пример #1
0
    def test_powerSetIssubsetAll(self):
        ps = PowerSet()
        ps.put(1)
        ps.put(-5)
        ps.put(13)
        ps.put(0)
        ps.put(4)
        ps.put(9)
        ps.put(92)
        ps.put(131)
        ps.put(11)
        ps.put(18)

        ps1 = PowerSet()
        ps1.put(1)
        ps1.put(-5)
        ps1.put(13)
        ps1.put(0)
        ps1.put(4)
        ps1.put(9)
        ps1.put(92)
        ps1.put(131)
        ps1.put(11)
        ps1.put(18)

        psIssubset = ps.issubset(ps1)
        self.assertEqual(psIssubset, True)
Пример #2
0
    def test_powerSetIssubsetNotAll1(self):
        ps = PowerSet()
        ps.put(1)
        ps.put(-5)
        ps.put(13)
        ps.put(0)
        ps.put(4)
        ps.put(9)
        ps.put(92)
        ps.put(131)
        ps.put(11)
        ps.put(18)
        ps.put(28)
        ps.put(-11)
        ps.put(999)

        ps1 = PowerSet()
        ps1.put(1)
        ps1.put(-5)
        ps1.put(13)
        ps1.put(0)
        ps1.put(4)
        ps1.put(9)
        ps1.put(92)
        ps1.put(131)
        ps1.put(11)
        ps1.put(18)
        ps1.put(55)
        ps1.put(888)

        psIssubset = ps.issubset(ps1)
        self.assertEqual(psIssubset, False)
Пример #3
0
    def test_issubset(self):
        ps1 = PowerSet()
        ps1.put('abc')
        ps1.put('def')
        ps1.put('ghx')
        ps1.put('cvb')

        ps2 = PowerSet()
        self.assertEqual(ps1.issubset(ps2), True)

        ps2.put('abc')
        self.assertEqual(ps1.issubset(ps2), True)

        ps2 = copy.deepcopy(ps1)
        self.assertEqual(ps1.issubset(ps2), True)

        ps2.put('ppp')
        self.assertEqual(ps1.issubset(ps2), False)