@@ -0,0 +1,1735 @@
+%22%22%22%0AUnit tests for Spacewalk runner%0A%22%22%22%0Aimport salt.runners.spacewalk as spacewalk%0Afrom tests.support.mock import Mock, call, patch%0A%0A%0Adef test_api_command_must_have_namespace():%0A    _get_session_mock = Mock(return_value=(None, None))%0A%0A    with patch.object(spacewalk, %22_get_session%22, _get_session_mock):%0A        result = spacewalk.api(%22mocked.server%22, %22badMethod%22)%0A        assert result == %7B%0A            %22badMethod ()%22: %22Error: command must use the following format: 'namespace.method'%22%0A        %7D%0A%0A%0Adef test_api_command_accepts_single_namespace():%0A    client_mock = Mock()%0A    _get_session_mock = Mock(return_value=(client_mock, %22key%22))%0A    getattr_mock = Mock(return_value=%22mocked_getattr_return%22)%0A%0A    with patch.object(spacewalk, %22_get_session%22, _get_session_mock):%0A        with patch.object(spacewalk, %22getattr%22, getattr_mock):%0A            spacewalk.api(%22mocked.server%22, %22system.listSystems%22)%0A            getattr_mock.assert_has_calls(%0A                %5B%0A                    call(client_mock, %22system%22),%0A                    call(%22mocked_getattr_return%22, %22listSystems%22),%0A                %5D%0A            )%0A%0A%0Adef test_api_command_accepts_nested_namespace():%0A    client_mock = Mock()%0A    _get_session_mock = Mock(return_value=(client_mock, %22key%22))%0A    getattr_mock = Mock(return_value=%22mocked_getattr_return%22)%0A%0A    with patch.object(spacewalk, %22_get_session%22, _get_session_mock):%0A        with patch.object(spacewalk, %22getattr%22, getattr_mock):%0A            spacewalk.api(%22mocked.server%22, %22channel.software.listChildren%22)%0A            getattr_mock.assert_has_calls(%0A                %5B%0A                    call(client_mock, %22channel.software%22),%0A                    call(%22mocked_getattr_return%22, %22listChildren%22),%0A                %5D%0A            )%0A

Add spacewalk runner command parsing tests