Esempio n. 1
0
 def test_right_functional_cache(self):
     """Basic tests of is_right_functional()."""
     c = ac['clan4']
     self.assertEqual(c.cached_right_functional, CacheStatus.UNKNOWN)
     self.assertTrue(is_right_functional(c))
     self.assertTrue(_props.is_right_functional(c))
     self.assertEqual(c.cached_right_functional, CacheStatus.IS)
     self.assertTrue(is_right_functional(c))
     self.assertTrue(_props.is_right_functional(c))
     c = ac['clan3']
     self.assertEqual(c.cached_right_functional, CacheStatus.UNKNOWN)
     self.assertFalse(is_right_functional(c))
     self.assertFalse(_props.is_right_functional(c))
     self.assertEqual(c.cached_right_functional, CacheStatus.IS_NOT)
 def test_right_functional_cache(self):
     """Basic tests of is_right_functional()."""
     c = ac['clan4']
     self.assertEqual(c.cached_right_functional, CacheStatus.UNKNOWN)
     self.assertTrue(is_right_functional(c))
     self.assertTrue(_props.is_right_functional(c))
     self.assertEqual(c.cached_right_functional, CacheStatus.IS)
     self.assertTrue(is_right_functional(c))
     self.assertTrue(_props.is_right_functional(c))
     c = ac['clan3']
     self.assertEqual(c.cached_right_functional, CacheStatus.UNKNOWN)
     self.assertFalse(is_right_functional(c))
     self.assertFalse(_props.is_right_functional(c))
     self.assertEqual(c.cached_right_functional, CacheStatus.IS_NOT)
 def _test_undef(cc):
     self.assertIs(cc.get_left_set(), Undef())
     self.assertIs(is_functional(cc), Undef())
     self.assertIs(cc.get_right_set(), Undef())
     self.assertIs(is_right_functional(cc), Undef())
     self.assertIs(is_bijective(cc), Undef())
     self.assertIs(is_transitive(cc), Undef())
     self.assertIs(is_equivalence_relation(cc), Undef())
 def _test_undef(cc):
     self.assertIs(cc.get_left_set(), Undef())
     self.assertIs(is_functional(cc), Undef())
     self.assertIs(cc.get_right_set(), Undef())
     self.assertIs(is_right_functional(cc), Undef())
     self.assertIs(is_bijective(cc), Undef())
     self.assertIs(is_transitive(cc), Undef())
     self.assertIs(is_equivalence_relation(cc), Undef())
Esempio n. 5
0
 def test_properties(self):
     a = ba['2']
     self.assertIs(a.get_left_set(), Undef())
     self.assertIs(is_functional(a), Undef())
     self.assertIs(a.get_right_set(), Undef())
     self.assertIs(is_right_functional(a), Undef())
     self.assertIs(is_bijective(a), Undef())
     self.assertIs(is_reflexive(a), Undef())
     self.assertIs(is_symmetric(a), Undef())
     self.assertIs(is_transitive(a), Undef())
     self.assertIs(is_equivalence_relation(a), Undef())
 def test_properties(self):
     a = ba['2']
     self.assertIs(a.get_left_set(), Undef())
     self.assertIs(is_functional(a), Undef())
     self.assertIs(a.get_right_set(), Undef())
     self.assertIs(is_right_functional(a), Undef())
     self.assertIs(is_bijective(a), Undef())
     self.assertIs(is_reflexive(a), Undef())
     self.assertIs(is_symmetric(a), Undef())
     self.assertIs(is_transitive(a), Undef())
     self.assertIs(is_equivalence_relation(a), Undef())
Esempio n. 7
0
    def test_right_functional(self):
        self.assertTrue(is_right_functional(Set()))
        self.assertIs(is_right_functional(Set('a', 'b', 'c')), Undef())
        f = is_right_functional(basic_sets['left func'])
        self.assertTrue(f)
        f = is_right_functional(basic_sets['not right func'])
        self.assertFalse(f)
        f = is_right_functional(basic_clans['left func'])
        self.assertTrue(f)
        f = is_right_functional(basic_clans['not right func'])
        self.assertFalse(f)
        f = is_right_functional(basic_hordes['left func'])
        self.assertTrue(f)
        f = is_right_functional(basic_hordes['not right func'])
        self.assertFalse(f)

        s = basic_sets['left func']
        self.assertEqual(s.cached_right_functional, CacheStatus.IS)
        s = basic_sets['not right func']
        self.assertEqual(s.cached_right_functional, CacheStatus.IS_NOT)
    def test_right_functional(self):
        self.assertTrue(is_right_functional(Set()))
        self.assertIs(is_right_functional(Set("a", "b", "c")), Undef())
        f = is_right_functional(basic_sets["left func"])
        self.assertTrue(f)
        f = is_right_functional(basic_sets["not right func"])
        self.assertFalse(f)
        f = is_right_functional(basic_clans["left func"])
        self.assertTrue(f)
        f = is_right_functional(basic_clans["not right func"])
        self.assertFalse(f)
        f = is_right_functional(basic_hordes["left func"])
        self.assertTrue(f)
        f = is_right_functional(basic_hordes["not right func"])
        self.assertFalse(f)

        s = basic_sets["left func"]
        self.assertEqual(s.cached_right_functional, CacheStatus.IS)
        s = basic_sets["not right func"]
        self.assertEqual(s.cached_right_functional, CacheStatus.IS_NOT)
    def test_right_functional(self):
        self.assertTrue(is_right_functional(Set()))
        self.assertIs(is_right_functional(Set('a', 'b', 'c')), Undef())
        f = is_right_functional(basic_sets['left func'])
        self.assertTrue(f)
        f = is_right_functional(basic_sets['not right func'])
        self.assertFalse(f)
        f = is_right_functional(basic_clans['left func'])
        self.assertTrue(f)
        f = is_right_functional(basic_clans['not right func'])
        self.assertFalse(f)
        f = is_right_functional(basic_hordes['left func'])
        self.assertTrue(f)
        f = is_right_functional(basic_hordes['not right func'])
        self.assertFalse(f)

        s = basic_sets['left func']
        self.assertEqual(s.cached_right_functional, CacheStatus.IS)
        s = basic_sets['not right func']
        self.assertEqual(s.cached_right_functional, CacheStatus.IS_NOT)