def test_install_agent(self): """ Tests if it downloads Server Density installation agent, and installs sd-agent with agent_key. """ mock = MagicMock(return_value=True) with patch.dict(serverdensity_device.__pillar__, {"serverdensity": {"account_url": "salt"}}): with patch.dict(serverdensity_device.__salt__, {"cmd.run": mock}): with patch.dict(serverdensity_device.__opts__, {"cachedir": "/"}): self.assertTrue(serverdensity_device.install_agent("51f7e"))
def test_install_agent(self): ''' Tests if it downloads Server Density installation agent, and installs sd-agent with agent_key. ''' mock = MagicMock(return_value=True) with patch.dict(serverdensity_device.__pillar__, {'serverdensity': {'account_url': 'salt'}}): with patch.dict(serverdensity_device.__salt__, {'cmd.run': mock}): with patch.dict(serverdensity_device.__opts__, {'cachedir': '/'}): self.assertTrue(serverdensity_device.install_agent('51f7e'))
def test_install_agent(self): """ Tests if it downloads Server Density installation agent, and installs sd-agent with agent_key. """ mock = MagicMock(return_value=True) with patch.dict(serverdensity_device.__pillar__, {"serverdensity": { "account_url": "salt" }}): with patch.dict(serverdensity_device.__salt__, {"cmd.run": mock}): with patch.dict(serverdensity_device.__opts__, {"cachedir": "/"}): self.assertTrue( serverdensity_device.install_agent("51f7e"))