File: test_conftest.py

package info (click to toggle)
cloud-init 20.2-2~deb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,276 kB
  • sloc: python: 69,663; sh: 3,915; makefile: 105; xml: 21
file content (18 lines) | stat: -rw-r--r-- 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest

from cloudinit import util


class TestDisableSubpUsage:

    def test_using_subp_raises_assertion_error(self):
        with pytest.raises(AssertionError):
            util.subp(["some", "args"])

    def test_typeerrors_on_incorrect_usage(self):
        with pytest.raises(TypeError):
            util.subp()

    @pytest.mark.parametrize('disable_subp_usage', [False], indirect=True)
    def test_subp_usage_can_be_reenabled(self):
        util.subp(['whoami'])