Ejemplo n.º 1
0
 def test_export_spreadsheet_invalid_input(self):
     """Test exporting spreadsheet with bad input raises errors. Will fail if no Internet connection."""
     client = self.getClient()
     if client:
         # Nonexisting header.
         self.assertRaises(GoogleSpreadsheetError, _export_spreadsheet,
                           client, self.spreadsheet_key, self.worksheet_id,
                           ['#SampleID', 'Foo'])
     else:
         raise GoogleSpreadsheetConnectionError("Cannot execute test "
                                                "without an active Internet connection.")
Ejemplo n.º 2
0
 def test_get_spreadsheet_headers(self):
     """Test reading the header line from a spreadsheet. Will fail if no Internet connection."""
     client = self.getClient()
     if client:
         exp = ['#SampleID', 'BarcodeSequence', 'LinkerPrimerSequence',
                'Treatment', 'DOB', 'Description']
         obs = _get_spreadsheet_headers(client, self.spreadsheet_key,
                                        self.worksheet_id)
         self.assertEqual(obs, exp)
     else:
         raise GoogleSpreadsheetConnectionError("Cannot execute test "
                                                "without an active Internet connection.")
Ejemplo n.º 3
0
 def test_export_spreadsheet(self):
     """Test exporting spreadsheet as TSV. Will fail if no Internet connection."""
     client = self.getClient()
     if client:
         exp = [['#SampleID', 'DOB'],
                ['#Example mapping file for the QIIME analysis package.  '
                 'These 9 samples are from a study of the effects of exercise '
                 'and diet on mouse cardiac physiology (Crawford, et al, '
                 'PNAS, 2009).'], ['PC.354', '20061218'],
                ['PC.355', '20061218'], ['PC.356', '20061126'],
                ['PC.481', '20070314'], ['PC.593', '20071210'],
                ['PC.607', '20071112'], ['PC.634', '20080116'],
                ['PC.635', '20080116'], ['PC.636', '20080116']]
         obs = _export_spreadsheet(client, self.spreadsheet_key,
                                   self.worksheet_id, ['#SampleID', 'DOB'])
         self.assertEqual(obs, exp)
     else:
         raise GoogleSpreadsheetConnectionError("Cannot execute test "
                                                "without an active Internet connection.")