# Path: f8a_worker/workers/new_init_package_analysis_flow.py
# class NewInitPackageAnlysisFlow(BaseTask):
#     """Initialize package-level analysis."""
# 
#     def execute(self, arguments):
#         """Task code.
# 
#         :param arguments: dictionary with task arguments
#         :return: {}, results
#         """
#         self._strict_assert(isinstance(arguments.get('ecosystem'), str))
#         self._strict_assert(isinstance(arguments.get('name'), str))
# 
#         if arguments['ecosystem'] not in _SUPPORTED_ECOSYSTEMS:
#             raise FatalTaskError('Unknown ecosystem: %r' % arguments['ecosystem'])
# 
#         # Don't ingest for private packages
#         if not is_pkg_public(arguments['ecosystem'], arguments['name']):
#             logger.info("Private package ingestion ignored %s %s",
#                         arguments['ecosystem'], arguments['name'])
#             raise NotABugFatalTaskError("Private package alert {} {}".format(
#                 arguments['ecosystem'], arguments['name']))
# 
#         return arguments


from unittest import TestCase
from selinon import FatalTaskError
from f8a_worker.workers.new_init_package_analysis_flow import NewInitPackageAnlysisFlow
from unittest import mock
"""Tests for NewInitPackageFlow module."""



data_v1 = {
        "ecosystem": "dummy_eco",
        "name": "dummy_name"
}

data_v2 = {
        "ecosystem": "golang",
        "name": "dummy_name"
}


class TestInitPackageFlowNew(TestCase):
    """Tests for the NewInitPackageFlow task."""

    def _strict_assert(self, assert_cond):
        if not assert_cond:
            False

    def test_execute(self):
        """Tests for 'execute'."""

# Path: f8a_worker/workers/new_init_package_analysis_flow.py
# class NewInitPackageAnlysisFlow(BaseTask):
#     """Initialize package-level analysis."""
# 
#     def execute(self, arguments):
#         """Task code.
# 
#         :param arguments: dictionary with task arguments
#         :return: {}, results
#         """
#         self._strict_assert(isinstance(arguments.get('ecosystem'), str))
#         self._strict_assert(isinstance(arguments.get('name'), str))
# 
#         if arguments['ecosystem'] not in _SUPPORTED_ECOSYSTEMS:
#             raise FatalTaskError('Unknown ecosystem: %r' % arguments['ecosystem'])
# 
#         # Don't ingest for private packages
#         if not is_pkg_public(arguments['ecosystem'], arguments['name']):
#             logger.info("Private package ingestion ignored %s %s",
#                         arguments['ecosystem'], arguments['name'])
#             raise NotABugFatalTaskError("Private package alert {} {}".format(
#                 arguments['ecosystem'], arguments['name']))
# 
#         return arguments


# Path: tests/workers/test_new_init_package_analysis_flow.py
from unittest import TestCase
from selinon import FatalTaskError
from f8a_worker.workers.new_init_package_analysis_flow import NewInitPackageAnlysisFlow
from unittest import mock

"""Tests for NewInitPackageFlow module."""



data_v1 = {
        "ecosystem": "dummy_eco",
        "name": "dummy_name"
}

data_v2 = {
        "ecosystem": "golang",
        "name": "dummy_name"
}


class TestInitPackageFlowNew(TestCase):
    """Tests for the NewInitPackageFlow task."""

    def _strict_assert(self, assert_cond):
        if not assert_cond:
            False

    def test_execute(self):
        """Tests for 'execute'."""

        self.assertRaises(FatalTaskError, NewInitPackageAnlysisFlow.execute, self, data_v1)