Beispiel #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("/"))
Beispiel #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))
Beispiel #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))
Beispiel #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('/'))
Beispiel #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))
Beispiel #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('/'))
Beispiel #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))
Beispiel #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('/'))