def test_sweepFiles_fileNotDirectory(self): with self.assertRaises(IOError): io.sweepFiles('phylodist/test.py') def test_sweepFiles_nonExistentDir(self): with self.assertRaises(IOError): io.sweepFiles('directory_does_not_exist') def test_sweepFiles_directoryType(self): with self.assertRaises(TypeError): io.sweepFiles(42) def test_sweepFiles_metadataType(self): with self.assertRaises(TypeError): io.sweepFiles('examples', metadata=41) def test_sweepFiles_values(self): pdSD = io.sweepFiles('examples') # check the length of the dictionary self.assertEquals(len(pdSD), 2) # verify the sample key names are correct for key in pdSD.keys(): self.assertIn(key, ['LakWasMeta9_HOW4', 'LakWasMeta9_HOW4_2']) # spot check specific values in the dictionary's data frame self.assertEquals( pdSD['LakWasMeta9_HOW4'].at[97, 'locus_tag'], 'Ga0066407_15607121' ) self.assertEquals( pdSD['LakWasMeta9_HOW4_2'].at[1013, 'locus_tag'], 'Ga0066495_1323232' )
def test_sweepFiles_values(self): pdSD = io.sweepFiles('examples') # check the length of the dictionary self.assertEquals(len(pdSD), 2) # verify the sample key names are correct for key in pdSD.keys(): self.assertIn(key, ['LakWasMeta9_HOW4', 'LakWasMeta9_HOW4_2']) # spot check specific values in the dictionary's data frame self.assertEquals( pdSD['LakWasMeta9_HOW4'].at[97, 'locus_tag'], 'Ga0066407_15607121' ) self.assertEquals( pdSD['LakWasMeta9_HOW4_2'].at[1013, 'locus_tag'], 'Ga0066495_1323232' )
def test_sweepFiles_metadataType(self): with self.assertRaises(TypeError): io.sweepFiles('examples', metadata=41)
def test_sweepFiles_directoryType(self): with self.assertRaises(TypeError): io.sweepFiles(42)
def test_sweepFiles_nonExistentDir(self): with self.assertRaises(IOError): io.sweepFiles('directory_does_not_exist')
def test_sweepFiles_fileNotDirectory(self): with self.assertRaises(IOError): io.sweepFiles('phylodist/test.py')