def test_show(self): ''' Test to show properties of one or more units/jobs or the manager ''' mock = MagicMock(return_value="a = b , c = d") with patch.dict(systemd.__salt__, {'cmd.run': mock}): self.assertDictEqual(systemd.show("sshd"), {'a ': ' b , c = d'})
def test_show(self): ''' Test to show properties of one or more units/jobs or the manager ''' show_output = 'a=b\nc=d\ne={ f=g ; h=i }\nWants=foo.service bar.service\n' mock = MagicMock(return_value=show_output) with patch.dict(systemd.__salt__, {'cmd.run': mock}): self.assertDictEqual( systemd.show('sshd'), {'a': 'b', 'c': 'd', 'e': {'f': 'g', 'h': 'i'}, 'Wants': ['foo.service', 'bar.service']} )