Exemple #1
0
 def test_percent_args(self):
     with patch.dict(disk.__grains__, {"kernel": "Linux"}), patch(
         "salt.modules.disk.percent", MagicMock(return_value="/")
     ):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {"cmd.run": mock}):
             self.assertEqual("/", disk.percent("/"))
Exemple #2
0
 def test_percent(self):
     with patch.dict(disk.__grains__, {"kernel": "Linux"}), patch(
         "salt.modules.disk.percent", MagicMock(return_value=STUB_DISK_PERCENT)
     ):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {"cmd.run": mock}):
             self.assertDictEqual(STUB_DISK_PERCENT, disk.percent(args=None))
Exemple #3
0
 def test_percent(self):
     with patch.dict(disk.__grains__, {'kernel': 'Linux'}), \
             patch('salt.modules.disk.percent',
                   MagicMock(return_value=STUB_DISK_PERCENT)):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {'cmd.run': mock}):
             self.assertDictEqual(STUB_DISK_PERCENT, disk.percent(args=None))
Exemple #4
0
 def test_percent_args(self):
     with patch.dict(disk.__grains__, {'kernel': 'Linux'}):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {'cmd.run': mock}):
             self.assertEqual('/', disk.percent('/'))
Exemple #5
0
 def test_percent(self):
     with patch.dict(disk.__grains__, {'kernel': 'Linux'}):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {'cmd.run': mock}):
             self.assertDictEqual(STUB_DISK_PERCENT, disk.percent(args=None))
Exemple #6
0
 def test_percent_args(self):
     with patch.dict(disk.__grains__, {'kernel': 'Linux'}):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {'cmd.run': mock}):
             self.assertEqual('/', disk.percent('/'))
Exemple #7
0
 def test_percent(self):
     with patch.dict(disk.__grains__, {'kernel': 'Linux'}):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {'cmd.run': mock}):
             self.assertDictEqual(STUB_DISK_PERCENT,
                                  disk.percent(args=None))
Exemple #8
0
 def test_percent_args(self):
     with patch.dict(disk.__grains__, {'kernel': 'Linux'}), \
             patch('salt.modules.disk.percent', MagicMock(return_value='/')):
         mock = MagicMock()
         with patch.dict(disk.__salt__, {'cmd.run': mock}):
             self.assertEqual('/', disk.percent('/'))