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