示例#1
0
 def command(self):
     self.load_wsgi_app()
     if len(self.args) > 1:
         day_of_week_override = int(self.args[0])
     else:
         day_of_week_override = None
     
     if len(self.args) > 2:
         weekdays_ahead = int(self.args[1])
     else:
         weekdays_ahead = 1
     
     setups = generate_daily_setups(weekdays_ahead=weekdays_ahead, day_of_week_override=day_of_week_override)
     Session.add_all(setups)
     Session.commit()
示例#2
0
 def setUp(self):
     super(TestNamePlate, self).setUp()
     self.nameVariant = QLBFile(dirname='Box 2 Alpha 03/TestProject_TestU_Test 2_2011_01_19_09_36',
                                run_id='nameVariant',
                                basename='TestProject_TestU_Test 2.qlp',
                                type='processed',
                                read_status=1,
                                mtime=datetime.now()-timedelta(0,0,3))
     
     self.unknownName = QLBFile(dirname='Box 2 Alpha 03/Unknown_TestU_Test_2011_01_19_09_36',
                                run_id='unknownName',
                                basename='Unknown_TestU_Test 2.qlp',
                                type='processed',
                                read_status=1,
                                mtime=datetime.now()-timedelta(0,0,5))
     
     self.plateTemplate = PlateTemplate(prefix='TestProject_TestU_Test',
                                        project_id=self.testProject.id,
                                        operator_id=self.testUser.id,
                                        dg_oil = 1,
                                        dr_oil = 2,
                                        master_mix = 10,
                                        fluidics_routine = 12,
                                        droplet_generation_method = 4)
     
     self.shortTemplate = PlateTemplate(prefix='TestProject_TestU',
                                        project_id=self.testProject.id,
                                        operator_id=self.testUser.id,
                                        dg_oil = 2,
                                        dr_oil = 3,
                                        master_mix = 2,
                                        fluidics_routine = 13,
                                        droplet_generation_method = 3)
                                       
     self.host_machine = Session.query(Box2).filter_by(src_dir='Box 2 Alpha 03').one()
     self.qlbPlate = QLBPlate(file=self.readQLP, host_machine=self.host_machine.os_name)
     self.plateVariant = QLBPlate(file=self.nameVariant, host_machine=self.host_machine.os_name)
     self.unknownPlate = QLBPlate(file=self.unknownName, host_machine=self.host_machine.os_name)
         
     Session.add_all([self.plateTemplate, self.nameVariant, self.unknownName, self.qlbPlate, self.plateVariant, self.unknownPlate, self.shortTemplate])
     Session.commit()
示例#3
0
 def setUp(self):
     from qtools.model import Person, Project, Session, QLBFile
     # just set up a few things as necessary
     self.testUser = Person(first_name=u'Test', last_name=u'User', name_code=u'TestU')
     self.testProject = Project(name=u'TestProject')
     
     # TODO: make a test folder with a real set of files
     self.readQLP = QLBFile(dirname='Box 2 Alpha 03/TestProject_TestU_Test_2011_01_19_09_36',
                            run_id='readQLP',
                            basename='TestProject_TestU_Test.qlp',
                            type='processed',
                            read_status=1,
                            mtime=datetime.now()-timedelta(0,0,1))
     
     self.unreadQLP = QLBFile(dirname='Box 2 Alpha 03/TestProject_TestU_Test_2011_01_19_09_37',
                              run_id='unreadQLP',
                              basename='TestProject_TestU_Test.qlp',
                              type='processed',
                              read_status=0,
                              mtime=datetime.now())
     
     # note: make sure this survives an error
     Session.add_all([self.testUser, self.testProject, self.readQLP, self.unreadQLP])
     Session.commit()