Exemplo n.º 1
0
                for mer1, mer2 in zip(*map(list, [sub1, sub2])):
                    if len(mer1.indicators) == len(mer2.indicators):
                        overfit_obj2.add_mer(mer1, mer2)
                    else:
                        self.assertRaises(TypeError, overfit_obj2.add_mer,
                                          mer1, mer2)
                        will_fail = True

                if will_fail:
                    self.assertRaises(TypeError, overfit_obj1.add_structure,
                                      sub1, sub2)
                    break

                overfit_obj1.add_structure(sub1, sub2)

                sums1 = overfit_obj1.get_sums()
                sums2 = overfit_obj2.get_sums()

                assert_sums_equal(self, sums1, sums2)


if __name__ == '__main__':
    if syntax_check.rip_argv('--skip-slow'):
        skip_slow = True

    if syntax_check.rip_argv('--fast'):
        fast = True

    unittest.main()
Exemplo n.º 2
0
                                                                   crit)))
        basic.addTests(
            loader.loadTestsFromTestCase(
                make_contactbasictest(name, contacts.CaCbxContact)))
        basic.addTests(loader.loadTestsFromTestCase(make_desctest(name)))
    test(contacts.CaCbxSubtractionCriterion)
    test(contacts.CaCbxSubtractionCriterion.__init__)
    test(contacts.CaCbxSubtractionCriterion.is_in_contact)
    # TO these are tested during tests added above while CaCbxContact finction calls CaCbxSubtractionCriterion methods
    test(contacts.VectorDistanceCriterion)
    test(contacts.VectorDistanceCriterion.__init__)
    # TO tested for subclass

    basic.addTests(
        loader.loadTestsFromTestCase(
            make_combcontactbasictest(contacts.ContactsAlternative)))
    basic.addTests(
        loader.loadTestsFromTestCase(
            make_combcontactbasictest(contacts.ContactsConjunction)))

    standard_tests.addTests(basic)

    return standard_tests


if __name__ == '__main__':
    if syntax_check.rip_argv('--fast'):
        fast = True

    unittest.main()