Add missing pytest.fixture
@@ -4,6 +4,8 @@ Testing of id command.
"""
__email__ = 'michal.ernst@nokia.com'
+import pytest
+
def test_id_returns_proper_command_string(buffer_connection):
from moler.cmd.unix.id import Id
@@ -20,70 +22,9 @@ def test_calling_id_returns_result_parsed_from_command_output(buffer_connection)
assert result == expected_result
+@pytest.fixture
def command_output_and_expected_result():
- data = """
-host:~ # id user
-uid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner),118(bluetooth)
-host:~ #
-"""
- result = {
- 'UID': [
- {
- 'ID': 1000,
- 'NAME': 'user'
- },
- ],
- 'GID': [
- {
- 'ID': 1000,
- 'NAME': 'user'
- }
- ],
- 'GROUPS': [
- {
- 'ID': 1000,
- 'NAME': 'user'
- },
- {
- 'ID': 24,
- 'NAME': 'cdrom'
- },
- {
- 'ID': 25,
- 'NAME': 'floppy'
- },
- {
- 'ID': 29,
- 'NAME': 'audio'
- },
- {
- 'ID': 30,
- 'NAME': 'dip'
- },
- {
- 'ID': 44,
- 'NAME': 'video'
- },
- {
- 'ID': 46,
- 'NAME': 'plugdev'
- },
- {
- 'ID': 108,
- 'NAME': 'netdev'
- },
- {
- 'ID': 110,
- 'NAME': 'lpadmin'
- },
- {
- 'ID': 113,
- 'NAME': 'scanner'
- },
- {
- 'ID': 118,
- 'NAME': 'bluetooth'
- }
- ]
- }
+ from moler.cmd.unix.id import COMMAND_OUTPUT_ver_execute as data
+ from moler.cmd.unix.id import COMMAND_RESULT_ver_execute as result
+
return data, result
