# Path: src/petmail/test/common.py
# def flip_bit(s):
#     return s[:-1] + chr(ord(s[-1]) ^ 0x01)


from twisted.trial import unittest
from .. import rrid
from .common import flip_bit

class RRID(unittest.TestCase):
    def test_create(self):
        binary = type(b"")
        privkey, pubkey = rrid.create_keypair()
        tokenid, token0 = rrid.create_token(pubkey)
        self.failUnlessEqual((type(privkey), type(pubkey)), (binary, binary))

# Path: src/petmail/test/common.py
# def flip_bit(s):
#     return s[:-1] + chr(ord(s[-1]) ^ 0x01)


# Path: src/petmail/test/test_rrid.py
from twisted.trial import unittest
from .. import rrid
from .common import flip_bit


class RRID(unittest.TestCase):
    def test_create(self):
        binary = type(b"")
        privkey, pubkey = rrid.create_keypair()
        tokenid, token0 = rrid.create_token(pubkey)
        self.failUnlessEqual((type(privkey), type(pubkey)), (binary, binary))

        self.failUnlessEqual((type(tokenid), type(token0)), (binary, binary))