コード例 #1
0
 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'])
コード例 #2
0
ファイル: debian_service_test.py プロジェクト: DaveQB/salt
 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'])
コード例 #3
0
 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"])
コード例 #4
0
 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