1234567891011121314151617181920212223242526272829 |
- import unittest.mock
- import pytest
- import systemctl_mqtt._utils
- @pytest.mark.parametrize("hostname", ["test"])
- def test__get_hostname(hostname):
- with unittest.mock.patch("socket.gethostname", return_value=hostname):
-
- assert systemctl_mqtt._utils.get_hostname() == hostname
|