pysss_murmur-test.py revision 341a00311680a440d7f979f06c34c70d86c9367a
# SSSD
#
# Unit tests for pysss_murmur
#
# Copyright (C) Sumit Bose <sbose@redhat.com> 2012
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import unittest
import sys
import os
import copy
if not srcdir:
srcdir = "."
# add compat methods for old unittest.TestCase versions
# (python < 2.7, RHEL5 for instance)
" Make sure we load the in-tree module "
print(MODPATH)
" Restore the system path "
def testImport(self):
" Import the module and assert it comes from tree "
try:
import pysss_murmur
except ImportError as e:
raise e
def testExpectedHash(self):
def testInvalidArguments(self):
0xffffffffff)
0xffffffffff, 3)
if __name__ == "__main__":
error = 0
if not res.wasSuccessful():
error |= 0x1
# need to bail out here because pysss_murmur could not be imported
# import the pysss_murmur module into the global namespace, but make sure
# it's the one in tree
import pysss_murmur
if not res.wasSuccessful():
error |= 0x2