server/test/unittest_msplanner.py
changeset 2181 94ca417b9b07
parent 2180 bf2e81fb52be
child 2608 21856eda34f6
child 2688 afa99d53401c
equal deleted inserted replaced
2144:51c84d585456 2181:94ca417b9b07
  1932                      None, None, [self.system],
  1932                      None, None, [self.system],
  1933                      {'U': 'table1.C0', 'UL': 'table1.C1'},
  1933                      {'U': 'table1.C0', 'UL': 'table1.C1'},
  1934                      [])],
  1934                      [])],
  1935                    {'x': self.session.user.eid})
  1935                    {'x': self.session.user.eid})
  1936 
  1936 
       
  1937     def test_nonregr14_1(self):
       
  1938         repo._type_source_cache[999999] = ('CWUser', 'ldap', 999999)
       
  1939         self._test('Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s',
       
  1940                    [('OneFetchStep', [('Any 999999 WHERE 999999 owned_by 999999', [{}])],
       
  1941                      None, None, [self.system], {}, [])],
       
  1942                    {'x': 999999, 'u': 999999})
       
  1943 
       
  1944     def test_nonregr14_2(self):
       
  1945         repo._type_source_cache[999999] = ('CWUser', 'ldap', 999999)
       
  1946         repo._type_source_cache[999998] = ('Note', 'system', 999998)
       
  1947         self._test('Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s',
       
  1948                    [('OneFetchStep', [('Any 999998 WHERE 999998 owned_by 999999', [{}])],
       
  1949                      None, None, [self.system], {}, [])],
       
  1950                    {'x': 999998, 'u': 999999})
       
  1951 
       
  1952     def test_nonregr14_3(self):
       
  1953         repo._type_source_cache[999999] = ('CWUser', 'system', 999999)
       
  1954         repo._type_source_cache[999998] = ('CWUser', 'ldap', 999998)
       
  1955         self._test('Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s',
       
  1956                    [('OneFetchStep', [('Any 999998 WHERE 999998 owned_by 999999', [{}])],
       
  1957                      None, None, [self.system], {}, [])],
       
  1958                    {'x': 999998, 'u': 999999})
       
  1959 
  1937 
  1960 
  1938 class MSPlannerTwoSameExternalSourcesTC(BasePlannerTC):
  1961 class MSPlannerTwoSameExternalSourcesTC(BasePlannerTC):
  1939     """test planner related feature on a 3-sources repository:
  1962     """test planner related feature on a 3-sources repository:
  1940 
  1963 
  1941     * 2 rql sources supporting Card
  1964     * 2 rql sources supporting Card
  2070                                        [{'AA': 'String', 'AB': 'Datetime', 'X': 'State'}])],
  2093                                        [{'AA': 'String', 'AB': 'Datetime', 'X': 'State'}])],
  2071                      None, None, [self.cards], {}, []
  2094                      None, None, [self.cards], {}, []
  2072                      )],
  2095                      )],
  2073                    {'x': 999999})
  2096                    {'x': 999999})
  2074 
  2097 
       
  2098     def test_nonregr_eid_query(self):
       
  2099         self.repo._type_source_cache[999999] = ('Note', 'cards', 999999)
       
  2100         self._test('Any X WHERE X eid 999999',
       
  2101                    [('OneFetchStep', [('Any 999999', [{}])],
       
  2102                      None, None, [self.system], {}, []
       
  2103                      )],
       
  2104                    {'x': 999999})
       
  2105 
  2075 
  2106 
  2076 
  2107 
  2077 class FakeVCSSource(AbstractSource):
  2108 class FakeVCSSource(AbstractSource):
  2078     uri = 'ccc'
  2109     uri = 'ccc'
  2079     support_entities = {'Card': True, 'Note': True}
  2110     support_entities = {'Card': True, 'Note': True}