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