def get_robot_cache_keys_and_controllers(cls, affected_refs):
        """
        Gets cache keys and controllers that reference this robot
        """
        team_keys = affected_refs['team']

        return cls._get_robots_cache_keys_and_controllers(team_keys) + \
            cls._queries_to_cache_keys_and_controllers(get_affected_queries.robot_updated(affected_refs))
Esempio n. 2
0
    def get_robot_cache_keys_and_controllers(cls, affected_refs):
        """
        Gets cache keys and controllers that reference this robot
        """
        team_keys = affected_refs['team']

        return cls._get_robots_cache_keys_and_controllers(team_keys) + \
            cls._queries_to_cache_keys_and_controllers(get_affected_queries.robot_updated(affected_refs))
    def test_robot_updated(self):
        affected_refs = {
            'team': {ndb.Key(Team, 'frc254'), ndb.Key(Team, 'frc604')},
        }
        cache_keys = [q.cache_key for q in get_affected_queries.robot_updated(affected_refs)]

        self.assertEqual(len(cache_keys), 2)
        self.assertTrue(TeamRobotsQuery('frc254').cache_key in cache_keys)
        self.assertTrue(TeamRobotsQuery('frc604').cache_key in cache_keys)
    def test_robot_updated(self):
        affected_refs = {
            'team': {ndb.Key(Team, 'frc254'), ndb.Key(Team, 'frc604')},
        }
        cache_keys = [q.cache_key for q in get_affected_queries.robot_updated(affected_refs)]

        self.assertEqual(len(cache_keys), 2)
        self.assertTrue(TeamRobotsQuery('frc254').cache_key in cache_keys)
        self.assertTrue(TeamRobotsQuery('frc604').cache_key in cache_keys)