move matchers unit tests to pytest

This commit is contained in:
MKLeb 2022-09-20 19:12:22 -04:00 committed by Megan Wilhite
parent 5b2b6e826c
commit 3cd2d1c39e
4 changed files with 16 additions and 14 deletions

View file

@ -160,7 +160,7 @@ salt/matchers/*:
- integration.states.test_match
- pytests.integration.cli.test_matcher
- pytests.unit.modules.test_match
- unit.matchers.test_confirm_top
- pytests.unit.matchers.test_confirm_top
salt/proxy/*:
- pytests.integration.proxy.test_shell

View file

View file

@ -0,0 +1,15 @@
import pytest
import salt.config
import salt.loader
@pytest.fixture
def matchers():
opts = salt.config.DEFAULT_MINION_OPTS.copy()
return salt.loader.matchers(opts)
def test_sanity(matchers):
match = matchers["confirm_top.confirm_top"]
assert match("*", []) is True

View file

@ -1,13 +0,0 @@
import salt.config
import salt.loader
from tests.support.unit import TestCase
class ConfirmTop(TestCase):
def setUp(self):
opts = salt.config.DEFAULT_MINION_OPTS.copy()
self.matchers = salt.loader.matchers(opts)
def test_sanity(self):
match = self.matchers["confirm_top.confirm_top"]
self.assertTrue(match("*", []))