import unittest, os
from igf_data.illumina.samplesheet import SampleSheet
from igf_data.process.singlecell_seqrun.processsinglecellsamplesheet import ProcessSingleCellSamplesheet

class ProcessSingleCellSamplesheet_testA(unittest.TestCase):
  def setUp(self):
    self.samplesheet_file='data\singlecell_data\SampleSheet.csv'
    self.singlecell_barcode_json='data\singlecell_data\chromium-shared-sample-indexes-plate_20180301.json'
    self.output_file='data\singlecell_data\mod_SampleSheet.csv'
    if os.path.exists(self.output_file):
      os.remove(self.output_file)
    
  def tearDown(self):
    if os.path.exists(self.output_file):
      os.remove(self.output_file)
    
  def test_change_singlecell_barcodes(self):
    sc_data=ProcessSingleCellSamplesheet(samplesheet_file=self.samplesheet_file,\
                                         singlecell_barcode_json=self.singlecell_barcode_json)
    sc_data.change_singlecell_barcodes(output_samplesheet=self.output_file)
    sc_samplesheet=SampleSheet(infile=self.output_file)
    sc_samplesheet.filter_sample_data(condition_key='Sample_Project',\
                                      condition_value='project_2', \
                                      method='include')
    self.assertEqual(len(sc_samplesheet._data),8)
    sc_samplesheet.filter_sample_data(condition_key='Sample_ID',\
                                      condition_value='IGF0008_1', \
                                      method='include')
    self.assertEqual(len(sc_samplesheet._data),1)
    sc_index=sc_samplesheet._data[0]['index']
    self.assertTrue(sc_index , ["GTGTATTA", "TGTGCGGG", "ACCATAAC", "CAACGCCT"])
if __name__=='__main__':
  unittest.main()
@@ -282,33 +282,33 @@
 sheet_file='data
-%5C
+/
 singlecell_data%5C
@@ -306,17 +306,17 @@
 ell_data
-%5C
+/
 SampleSh
@@ -359,25 +359,25 @@
 e_json='data
-%5C
+/
 singlecell_d
@@ -379,17 +379,17 @@
 ell_data
-%5C
+/
 chromium
@@ -459,17 +459,17 @@
 le='data
-%5C
+/
 singlece
@@ -475,17 +475,17 @@
 ell_data
-%5C
+/
 mod_Samp
@@ -1713,8 +1713,10 @@
 t.main()
+%0D%0A

change to test file paths