예제 #1
0
def monitor(config,check_descrip,check_finish):
	rm = RunMonitor(config)
	if check_descrip:
		rm.check_missing_description()
	elif check_finish:
		rm.check_finish_status()
	else:
		rm.update_trello_board()
		rm.update_trello_project_board()
		rm.archive_cards()
예제 #2
0
 def test_update_trello_board(self):
     """Update Trello list with runs"""
     
     run_folders = ["120106_SN12345_0144_AABC123CXX",
                    "120521_M00123_0001_AFCGHY76-KTY500"]
     for d in run_folders:
         os.mkdir(os.path.join(self.dump_folder,d))
     
     rm = RunMonitor(self.config)
     rm.get_run_projects = mock.Mock(return_value=['J.Doe_11_01','J.Moe_12_02'])
     rm.get_status_list = mock.Mock(return_value='First read')
     rm.get_run_info = mock.Mock(return_value={'Reads': [{'NumCycles': 50},{'IsIndexedRead': 'Y'},{'NumCycles': 50}]})
     rm.get_run_parameters = mock.Mock(return_value={})
     
     rm.update_trello_board()
     lst = rm.trello.get_list(rm.trello_board,'First read')
     for run in run_folders:
         card = rm.trello.get_card(lst,run)
         self.assertIsNotNone(card,
                              "Could not locate created card for run")
         self.assertEqual(run,
                          card.name,
                          "Created card name and run name are not equal")
         shutil.rmtree(os.path.join(self.dump_folder,run))
         
     # Move a card to another list
     run = {'name': run_folders[0]}
     rm.list_runs = mock.Mock(return_value=[run])
     rm.get_status_list.return_value = 'Index read'
     rm.update_trello_board()
     lst = rm.trello.get_list(rm.trello_board,'Index read')
     card = rm.trello.get_card(lst,run['name'])
     self.assertIsNotNone(card,
                          "Could not locate created card for run")
     self.assertEqual(run['name'],
                      card.name,
                      "Created card name and run name are not equal")
예제 #3
0
def monitor(config):
    rm = RunMonitor(config)
    rm.update_trello_board()
    rm.update_trello_project_board()
    rm.archive_cards()