def test_update_jail(self): ''' Test if it run freebsd-update on `name` poudriere jail. ''' mock = MagicMock(return_value='90amd64 stack') with patch.dict(poudriere.__salt__, {'cmd.run': mock}): self.assertEqual(poudriere.update_jail('90amd64'), '90amd64 stack') self.assertEqual(poudriere.update_jail('80amd64'), 'Could not find jail 80amd64')
def test_update_jail(): """ Test if it run freebsd-update on `name` poudriere jail. """ mock = MagicMock(return_value="90amd64 stack") with patch.dict(poudriere.__salt__, {"cmd.run": mock}), patch( "salt.modules.poudriere._check_config_exists", MagicMock(return_value=True) ): assert poudriere.update_jail("90amd64") == "90amd64 stack" assert poudriere.update_jail("80amd64") == "Could not find jail 80amd64"
def test_update_jail(self): ''' Test if it run freebsd-update on `name` poudriere jail. ''' mock = MagicMock(return_value='90amd64 stack') with patch.dict(poudriere.__salt__, {'cmd.run': mock}), \ patch('salt.modules.poudriere._check_config_exists', MagicMock(return_value=True)): self.assertEqual(poudriere.update_jail('90amd64'), '90amd64 stack') self.assertEqual(poudriere.update_jail('80amd64'), 'Could not find jail 80amd64')