コード例 #1
0
ファイル: test_disk.py プロジェクト: zxstar/salt
 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("/"))
コード例 #2
0
ファイル: test_disk.py プロジェクト: zxstar/salt
 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))
コード例 #3
0
ファイル: test_disk.py プロジェクト: willmurnane/salt
 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))
コード例 #4
0
ファイル: disk_test.py プロジェクト: bryson/salt
 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('/'))
コード例 #5
0
ファイル: disk_test.py プロジェクト: bryson/salt
 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))
コード例 #6
0
ファイル: test_disk.py プロジェクト: yc2yuy/salt
 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('/'))
コード例 #7
0
ファイル: test_disk.py プロジェクト: yc2yuy/salt
 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))
コード例 #8
0
ファイル: test_disk.py プロジェクト: crimv42/saltstack
 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('/'))