Ejemplo n.º 1
0
 def test_sra_paired_export_run_set_xml(self):
     sra.export(self._inv_obj,
                self._tmp_dir,
                sra_settings=self._sra_default_config)
     with open(os.path.join(self._tmp_dir, 'run_set.xml'), 'rb') as out_fp:
         actual_run_set_xml_obj = etree.fromstring(out_fp.read())
         self.assertTrue(
             utils.assert_xml_equal(self._expected_run_set_xml_obj,
                                    actual_run_set_xml_obj))
Ejemplo n.º 2
0
 def test_isatab2sra_dump_run_set_xml_biis7(self):
     isatab2sra.convert(self._biis7_dir,
                        self._tmp_dir,
                        validate_first=False)
     with open(os.path.join(self._tmp_dir, 'run_set.xml'), 'rb') as rs_fp:
         run_set_xml = rs_fp.read()
         actual_run_set_xml_biis7 = etree.fromstring(run_set_xml)
         self.assertTrue(
             utils.assert_xml_equal(self._expected_run_set_xml_biis7,
                                    actual_run_set_xml_biis7))
Ejemplo n.º 3
0
 def test_isatab2sra_dump_submission_xml_biis3(self):
     isatab2sra.convert(self._biis3_dir,
                        self._tmp_dir,
                        validate_first=False)
     with open(os.path.join(self._tmp_dir, 'submission.xml'),
               'rb') as sub_fp:
         submission_xml = sub_fp.read()
         actual_submission_xml_biis3 = etree.fromstring(submission_xml)
         self.assertTrue(
             utils.assert_xml_equal(self._expected_submission_xml_biis3,
                                    actual_submission_xml_biis3))
Ejemplo n.º 4
0
 def test_isatab2sra_dump_project_set_xml_biis3(self):
     isatab2sra.convert(self._biis3_dir,
                        self._tmp_dir,
                        validate_first=False)
     with open(os.path.join(self._tmp_dir, 'project_set.xml'),
               'rb') as ps_fp:
         project_set_xml = ps_fp.read()
         actual_project_set_xml_biis3 = etree.fromstring(project_set_xml)
         self.assertTrue(
             utils.assert_xml_equal(self._expected_project_set_xml_biis3,
                                    actual_project_set_xml_biis3))
Ejemplo n.º 5
0
 def test_sra_dump_run_set_xml_biis3(self):
     with open(os.path.join(self._json_data_dir, 'BII-S-3',
                            'BII-S-3.json')) as json_fp:
         json2sra.convert(json_fp, self._tmp_dir, validate_first=False)
     # Now try load the SRA output in test and compare against the expected output in test data directory
     with open(os.path.join(self._tmp_dir, 'run_set.xml'), 'rb') as rs_fp:
         run_set_xml = rs_fp.read()
         actual_run_set_xml_biis3 = etree.fromstring(run_set_xml)
         self.assertTrue(
             utils.assert_xml_equal(self._expected_run_set_xml_biis3,
                                    actual_run_set_xml_biis3))
Ejemplo n.º 6
0
 def test_sra_dump_sample_set_xml_biis7(self):
     sra_settings = self._sra_default_config
     with open(os.path.join(self._json_data_dir, 'BII-S-7',
                            'BII-S-7.json')) as json_fp:
         json2sra.convert(json_fp,
                          self._tmp_dir,
                          sra_settings=sra_settings,
                          validate_first=False)
     # Now try load the SRA output in test and compare against the expected output in test data directory
     with open(os.path.join(self._tmp_dir, 'sample_set.xml'),
               'rb') as ss_fp:
         sample_set_xml = ss_fp.read()
         actual_sample_set_xml_biis7 = etree.fromstring(sample_set_xml)
         self.assertTrue(
             utils.assert_xml_equal(self._expected_sample_set_xml_biis7,
                                    actual_sample_set_xml_biis7))
Ejemplo n.º 7
0
 def test_isatab2sra_dump_submission_xml_biis7(self):
     sra_settings = {
         "sra_broker": "",
         "sra_center": "OXFORD",
         "sra_project": "OXFORD",
         "sra_lab": "Oxford e-Research Centre",
         "sra_broker_inform_on_status": "*****@*****.**",
         "sra_broker_inform_on_error": "*****@*****.**",
         "sra_broker_contact_name": "PRS"
     }
     isatab2sra.convert(self._biis3_dir,
                        self._tmp_dir,
                        sra_settings=sra_settings,
                        validate_first=False)
     with open(os.path.join(self._tmp_dir, 'submission.xml'),
               'rb') as sub_fp:
         submission_xml = sub_fp.read()
         actual_submission_xml_biis7 = etree.fromstring(submission_xml)
         self.assertTrue(
             utils.assert_xml_equal(self._expected_submission_xml_biis7,
                                    actual_submission_xml_biis7))
Ejemplo n.º 8
0
 def test_assert_xml_equal(self):
     self.assertTrue(
         utils.assert_xml_equal(etree.fromstring(self.x1),
                                etree.fromstring(self.x2)))