add service enabled test

This commit is contained in:
Frode Gundersen 2018-07-19 16:47:56 +00:00
parent 1643bb7fd4
commit 0747f2e58a
No known key found for this signature in database
GPG key ID: 49E5BDBFA6AFB570

View file

@ -239,6 +239,18 @@ class WinServiceTestCase(TestCase, LoaderModuleMockMixin):
self.assertTrue(win_service.enabled('spongebob'))
self.assertFalse(win_service.enabled('squarepants'))
def test_enabled_with_space_in_name(self):
'''
Test to check to see if the named
service is enabled to start on boot
when have space in service name
'''
mock = MagicMock(side_effect=[{'StartType': 'Auto'},
{'StartType': 'Disabled'}])
with patch.object(win_service, 'info', mock):
self.assertTrue(win_service.enabled('spongebob test'))
self.assertFalse(win_service.enabled('squarepants test'))
def test_disabled(self):
'''
Test to check to see if the named