def test_validate_metadata_file_invalid_ontology(self, mock_storage_client,
                                                     mock_storage_blob):
        """Unconventional metadata file should fail validation

        This basic test ensures that the external dependency
        `scp-ingest-pipeline` in our public CLI works as expected.
        """
        invalid_metadata_path = 'tests/data/invalid_array_v1.1.3.tsv'
        with self.assertRaises(SystemExit) as cm:
            validate_metadata_file(invalid_metadata_path)
        self.assertEqual(cm.exception.code, 1)
Пример #2
0
    def test_validate_metadata_file_invalid_ontology(self):
        """Unconventional metadata file should fail validation

        This basic test ensures that the external dependency
        `scp-ingest-pipeline` in our public CLI works as expected.
        """
        convention_path = '../demo_data/AMC_v1.1.0.json'
        invalid_metadata_path = 'tests/data/metadata_invalid_ontology.tsv'
        with self.assertRaises(SystemExit) as cm:
            validate_metadata_file(convention_path, invalid_metadata_path)
        self.assertEqual(cm.exception.code, 1)
    def test_validate_metadata_file_invalid_ontology(
        self, mock_succeeded, mock_get_api_base,
    ):
        """Unconventional metadata file should fail validation

        This basic test ensures that the external dependency
        `scp-ingest-pipeline` in our public CLI works as expected.
        """
        parsed_args = self.set_up_manage_study(
            'upload-metadata',
            '--study-name',
            'CLI test',
            '--file',
            'tests/data/invalid_array_v1.1.3.tsv',
            '--use-convention',
        )
        print(parsed_args)
        SCPAPIManager = Mock()
        SCPAPIManager.get_study_attribute.return_value = 'SCP555'

        invalid_metadata_path = 'tests/data/invalid_array_v1.1.3.tsv'
        with self.assertRaises(SystemExit) as cm:
            validate_metadata_file(parsed_args, mock_get_connection())
        self.assertEqual(cm.exception.code, 1)
    def test_validate_metadata_file_valid_ontology(
        self, mock_succeeded, mock_get_api_base,
    ):
        """Conventional metadata file should pass validation

        This basic test ensures that the external dependency
        `scp-ingest-pipeline` in our public CLI works as expected.
        """
        parsed_args = self.set_up_manage_study(
            'upload-metadata',
            '--study-name',
            'CLI test',
            '--file',
            'tests/data/valid_array_v20.0.0.tsv',
            '--use-convention',
        )
        SCPAPIManager = Mock()
        SCPAPIManager.get_study_attribute.return_value = 'SCP555'
        valid_metadata_path = 'tests/data/valid_array_v20.0.0.tsv'
        not self.assertRaises(
            SystemExit, validate_metadata_file(parsed_args, mock_get_connection())
        )
 def test_validate_metadata_file_valid_ontology(self, mock_storage_client,
                                                mock_storage_blob):
     """Conventional metadata file should pass validation
     """
     valid_metadata_path = 'tests/data/valid_array_v1.1.3.tsv'
     validate_metadata_file(valid_metadata_path)
Пример #6
0
 def test_validate_metadata_file_valid_ontology(self):
     """Conventional metadata file should pass validation
     """
     convention_path = '../demo_data/AMC_v1.1.0.json'
     valid_metadata_path = 'tests/data/metadata_valid_ontology.tsv'
     validate_metadata_file(convention_path, valid_metadata_path)