def generate_token(): """Generate a random token""" return base_encode(uuid.uuid4().int)
def test_encode(self): from velruse.baseconvert import base_encode self.assertEqual(base_encode(42), "L") self.assertEqual(base_encode(425242), "4rBC") self.assertEqual(base_encode(0), "2")
def test_encode(self): from velruse.baseconvert import base_encode self.assertEqual(base_encode(42), 'L') self.assertEqual(base_encode(425242), '4rBC') self.assertEqual(base_encode(0), '2')
def test_encode(self): eq_(base_encode(42), 'L') eq_(base_encode(425242), '4rBC') eq_(base_encode(0), '2')
def test_bad_encode(self): base_encode('fred')