Example #1
0
    def test_is_jail(self):
        '''
        Test if it return True if jail exists False if not.
        '''
        mock = MagicMock(return_value='salt stack')
        with patch.dict(poudriere.__salt__, {'cmd.run': mock}):
            self.assertTrue(poudriere.is_jail('salt'))

            self.assertFalse(poudriere.is_jail('SALT'))
Example #2
0
    def test_is_jail(self):
        '''
        Test if it return True if jail exists False if not.
        '''
        mock = MagicMock(return_value='salt stack')
        with patch.dict(poudriere.__salt__, {'cmd.run': mock}):
            self.assertTrue(poudriere.is_jail('salt'))

            self.assertFalse(poudriere.is_jail('SALT'))
Example #3
0
def test_is_jail():
    """
    Test if it return True if jail exists False if not.
    """
    mock = MagicMock(return_value="salt stack")
    with patch.dict(poudriere.__salt__, {"cmd.run": mock}), patch(
            "salt.modules.poudriere._check_config_exists",
            MagicMock(return_value=True)):
        assert poudriere.is_jail("salt")

        assert not poudriere.is_jail("SALT")