import pytest

from inputs.enums import LogInputType
from inputs.models import LogInput
from inputs.services.remove_loginputs import remove_all_log_inputs


@pytest.mark.django_db
@pytest.mark.selftest2
class TestRemoveLogInput:

    @pytest.mark.unit
    def test_remove(self):
        LogInput.objects.create(label='test_input', type=LogInputType.ARMAIF)
        LogInput.objects.create(label='test_input2', type=LogInputType.ENDPOINT)

        count_before = LogInput.objects.count()
        remove_all_log_inputs()
        count_after = LogInput.objects.count()

        assert count_after == 0
        assert count_before == 2
