def test_loadFile_exampleValues(self): # check the length pdDF = io.loadFile( 'examples/valid/' + 'example_Metatranscriptome_9_HOW4_[LakWasMeta9_HOW4_2]/IMG_Data/' + '61177.assembled.faa.phylodist', verbose=True ) self.assertEquals(len(pdDF.index), 10001) # spot check row 98's locus_tag self.assertEquals(pdDF.at[97, 'locus_tag'], 'Ga0066495_1324111')
def test_loadFile_filenameType(self): with self.assertRaises(TypeError): io.loadFile(42)
def test_loadFile_incorrectTaxFieldCount(self): with self.assertRaises(ValueError): io.loadFile('examples/invalid/badTaxRecordLength.phylodist')
def test_loadFile_directoryNotFile(self): with self.assertRaises(IOError): io.loadFile('examples')
def test_loadFile_nonExistentFile(self): with self.assertRaises(IOError): io.loadFile('file_does_not_exist')
def test_loadFile_verboseType(self): with self.assertRaises(TypeError): io.loadFile('filename', 42)
fpsClock = pygame.time.Clock() pygame.init() screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption('tsar-bomba - Model Maker') pygame.mouse.set_visible(1) running = True playAnim = False speed = 0 colors = colset.colorList() currentColor = (255,0,0) colorHistory = [] frameIndex = 0 speedTicks = [1,3,6,10,30] filename, model = io.loadFile(sys.argv) speed = model.speed print "Using: %s" % filename gui = GUI(screen) # all static parts of the GUI is drawn gui.drawColor(currentColor) gui.drawFrame(model.frame(frameIndex).grid) while running: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() if event.type == MOUSEBUTTONDOWN: