Esempio n. 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("/"))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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('/'))
Esempio n. 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))
Esempio n. 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('/'))
Esempio n. 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))
Esempio n. 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('/'))