def test_regular_cache(self):
     """Basic tests of is_regular()."""
     c = ac['clan3']
     self.assertEqual(c.cached_regular, CacheStatus.UNKNOWN)
     self.assertTrue(is_regular(c))
     self.assertTrue(_props.is_regular(c))
     self.assertEqual(c.cached_regular, CacheStatus.IS)
     self.assertTrue(is_regular(c))
     self.assertTrue(_props.is_regular(c))
     c = ac['clan5']
     self.assertEqual(c.cached_regular, CacheStatus.UNKNOWN)
     self.assertFalse(is_regular(c))
     self.assertFalse(_props.is_regular(c))
     self.assertEqual(c.cached_regular, CacheStatus.IS_NOT)
示例#2
0
 def test_regular_cache(self):
     """Basic tests of is_regular()."""
     c = ac['clan3']
     self.assertEqual(c.cached_regular, CacheStatus.UNKNOWN)
     self.assertTrue(is_regular(c))
     self.assertTrue(_props.is_regular(c))
     self.assertEqual(c.cached_regular, CacheStatus.IS)
     self.assertTrue(is_regular(c))
     self.assertTrue(_props.is_regular(c))
     c = ac['clan5']
     self.assertEqual(c.cached_regular, CacheStatus.UNKNOWN)
     self.assertFalse(is_regular(c))
     self.assertFalse(_props.is_regular(c))
     self.assertEqual(c.cached_regular, CacheStatus.IS_NOT)
示例#3
0
def _check_graph(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a :term:`graph`, ``False`` if not.

    ``obj`` is expected to be a :term:`clan`.
    """
    return obj.is_set and obj.get_left_set() == _mo.Set('s', 'p', 'o') \
        and _properties.is_regular(obj)
示例#4
0
def _check_graph(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a :term:`graph`, ``False`` if not.

    ``obj`` is expected to be a :term:`clan`.
    """
    return obj.is_set and obj.get_left_set() == _mo.Set('s', 'p', 'o') \
        and _properties.is_regular(obj)
示例#5
0
    def test_regular(self):
        lefts = basic_sets['left func/lefts']
        self.assertTrue(is_regular(Set()))
        self.assertIs(is_regular(lefts), Undef())
        self.assertIs(is_regular(basic_sets['left func']), Undef())
        self.assertTrue(is_regular(basic_clans['left func']))
        self.assertFalse(is_regular(basic_clans['left func2']))
        self.assertFalse(is_regular(basic_clans['not left func']))
        embedded_has_irregular_left = Set(basic_sets['left func'], basic_sets['not left func'])
        self.assertFalse(is_regular(embedded_has_irregular_left))

        s = basic_sets['left func']
        self.assertEqual(s.cached_regular, CacheStatus.N_A)
    def test_regular(self):
        lefts = basic_sets["left func/lefts"]
        self.assertTrue(is_regular(Set()))
        self.assertIs(is_regular(lefts), Undef())
        self.assertIs(is_regular(basic_sets["left func"]), Undef())
        self.assertTrue(is_regular(basic_clans["left func"]))
        self.assertFalse(is_regular(basic_clans["left func2"]))
        self.assertFalse(is_regular(basic_clans["not left func"]))
        embedded_has_irregular_left = Set(basic_sets["left func"], basic_sets["not left func"])
        self.assertFalse(is_regular(embedded_has_irregular_left))

        s = basic_sets["left func"]
        self.assertEqual(s.cached_regular, CacheStatus.N_A)