def test_get_disabled(self): ''' Test for Return a set of services that are installed but disabled ''' mock = MagicMock(return_value=['A']) with patch.object(debian_service, 'get_all', mock): mock = MagicMock(return_value=['B']) with patch.object(debian_service, 'get_enabled', mock): self.assertEqual(debian_service.get_disabled(), ['A'])
def test_get_disabled(self): """ Test for Return a set of services that are installed but disabled """ mock = MagicMock(return_value=["A"]) with patch.object(debian_service, "get_all", mock): mock = MagicMock(return_value=["B"]) with patch.object(debian_service, "get_enabled", mock): self.assertEqual(debian_service.get_disabled(), ["A"])
def test_get_disabled(self): get_all = MagicMock(return_value=["foo", "bar", "baz"]) get_enabled = MagicMock(return_value=["bar", "baz"]) with patch.object(debian_service, "get_all", get_all), patch.object(debian_service, "get_enabled", get_enabled): ret = debian_service.get_disabled() expected = ["foo"] assert ret == expected, ret