Ejemplo n.º 1
0
    def test_get_verify_working_verify_join(self, get_db_session):
        action_dal = ActionDal()

        session = WrapperHelper()
        get_db_session.return_value = [session]

        action_dal.get_verify_working(10)

        eq_(PipelineInstance, session.join_args[0])
Ejemplo n.º 2
0
    def test_get_verify_working_verify_results(self, get_db_session):
        action_dal = ActionDal()

        session = WrapperHelper()
        get_db_session.return_value = [session]

        action_instance = Mock(id=1, pipeline_instance_id=1)
        session.results.append(action_instance)

        results = action_dal.get_verify_working(10)

        eq_([action_instance.serialize()], results)
Ejemplo n.º 3
0
    def test_get_verify_working_verify_filter_args(self, get_db_session, base):
        action_dal = ActionDal()

        now = datetime.datetime.utcnow()
        diff = now - datetime.timedelta(minutes=10)

        session = WrapperHelper()
        get_db_session.return_value = [session]

        action_dal.get_verify_working(10)

        eq_(6, len(session.filter_args))

        filter_1 = session.filter_args[0]
        filter_2 = session.filter_args[1]
        filter_3 = session.filter_args[2]
        filter_4 = session.filter_args[3]
        filter_5 = session.filter_args[4]
        filter_6 = session.filter_args[5]

        eq_(PipelineInstance.__table__.columns['status_id'], filter_1.left)
        eq_(StatusConstants.INPROGRESS, filter_1.right.value)

        eq_(ActionInstance.__table__.columns['status_id'], filter_2.left)
        eq_(StatusConstants.INPROGRESS, filter_2.right.value)

        eq_(ActionInstance.__table__.columns['assigned_to'], filter_3.left)
        eq_('', filter_3.right.value)

        eq_(ActionInstance.__table__.columns['start_date'], filter_4.left)
        eq_(diff.minute, filter_4.right.value.minute)
        eq_(diff.day, filter_4.right.value.day)
        eq_(diff.year, filter_4.right.value.year)
        eq_(diff.hour, filter_4.right.value.hour)

        eq_(ActionInstance.__table__.columns['end_date'], filter_5.left)
        eq_(Boolean, type(filter_5.type))

        eq_(ActionInstance.__table__.columns['manual'], filter_6.left)
        eq_(0, filter_6.right.value)
Ejemplo n.º 4
0
 def client_verify_working(self):
     action_dal = ActionDal(None, None)
     return action_dal.get_verify_working(self.flask_app.rapid_config.queue_consider_late_time)