Ejemplo n.º 1
0
 def test_ddquery_diff_q_keys_some(self):
     q = [{"col1": "a", "col3": "a"}]
     d = [{"col1": "a", "col2": 1}]
     self.assertEqual(util.ddquery(q, d), (
         [],
         d,
     ))
Ejemplo n.º 2
0
 def test_ddquery_1q_1md(self):
     q = [{"col1": "a"}]
     d = [{"col1": "a", "col2": 1}]
     self.assertEqual(util.ddquery(q, d), (
         d,
         [],
     ))
Ejemplo n.º 3
0
 def test_ddquery_1q_1md_1nmd(self):
     q = [{"col1": "a"}]
     d = [{"col1": "a", "col2": 1}, {"col1": "b", "col2": 1}]
     self.assertEqual(util.ddquery(q, d), (
         [d[0]],
         [d[1]],
     ))
Ejemplo n.º 4
0
 async def _findNewTeams(self) -> List[dict]:
     logging.info("Retrieving teams from NFL API...")
     teams = self._apiClient.getTeams(active_only=False)
     cteams = await self.find()
     if len(cteams) > 0:
         tdiffs = util.ddquery(cteams, teams)
         teams = tdiffs[1]
     return teams
Ejemplo n.º 5
0
 def test_ddquery_2q_2md_1nmd(self):
     q = [{"col1": "a"}, {"col1": "b"}]
     md = [{"col1": "a", "col2": 1}, {"col1": "b", "col2": 1}]
     mmd = [{"col1": "c", "col2": 2}]
     d = md + mmd
     self.assertEqual(util.ddquery(q, d), (
         md,
         mmd,
     ))