def test_create_pass(self): t = Host(self.__salt__, **self.vars) t.mkconf = lambda: True t.mkdir = lambda x: True t.mklog = lambda x: True rv = t.create() ok_(rv is True, 'returned %s' % rv)
def test_create_fail(self): t = Host(self.__salt__, **self.vars) t.mkconf = Mock(side_effect=OSError) t.mkdir = Mock(side_effect=OSError) t.mklog = Mock(side_effect=OSError) rv = t.create() ok_(rv is False, 'returned %s' % rv)
def test_delete_true(self): t = Host(self.__salt__, **self.vars) rv = t.delete() ok_(rv is True, 'returned %s' % rv)
def unsuspend(**kwargs): ret = Host(__salt__, **kwargs) return ret.unsuspend()
def test_mklog_fail(self): t = Host(self.__salt__, **self.vars) rv = t.mklog('/tmp/') ok_(rv is False, 'returned %s' % rv)
def test_mkconf_fail(self): t = Host(self.__salt__, **self.vars) rv = t.mkconf() ok_(rv is False, 'returned %s' % rv)
def test_mklog_pass(self): t = Host(self.__salt__, **self.vars) rv = t.mklog('/tmp/') ok_(rv is True, 'returned %s' % rv)
def test_mkconf_pass(self): t = Host(self.__salt__, **self.vars) rv = t.mkconf() ok_(rv is True, 'returned %s' % rv)
def test_unsuspend_fail(self): t = Host(self.__salt__, **self.vars) rv = t.unsuspend() ok_(rv is False, 'returned %s' % rv)
def test_mksource_fail(self): t = Host(self.__salt__, **self.vars) rv = t.mksource('/tmp/') ok_(rv is True, 'returned %s' % rv)
def test_unsuspend_true(self): t = Host(self.__salt__, **self.vars) rv = t.unsuspend() ok_(rv is True, 'returned %s' % rv)
def test_delete_user(self): t = Host(self.__salt__, **self.vars) rv = t.delete(user=True) ok_(rv is False, 'returned %s' % rv)
def test_mksource_fail(self): t = Host(self.__salt__, **self.vars) t.mksource('/tmp/')
def test_mkdir_fail(self): t = Host(self.__salt__, **self.vars) rv = t.mkdir('/tmp/') ok_(rv is False, 'returned %s' % rv)
def delete(**kwargs): ret = Host(__salt__, **kwargs) return ret.delete(user=False)
def create(**kwargs): ret = Host(__salt__,**kwargs) return ret.create()
def test_delete_fail(self): t = Host(self.__salt__, **self.vars) rv = t.delete() ok_(rv is False, 'returned %s' % rv)
def create(**kwargs): ret = Host(__salt__, **kwargs) return ret.create()