def testMint(self): self.minter.nextn = 5432 id = self.minter.mint() self.assertEqual(id, "ark:/88434/pdr06f90") self.assertTrue(noid.validate(id)) with self.assertRaises(noid.ValidationError): noid.validate("ark:/88434/pdr06t90")
def test_seededmint(self): id = self.mntr._seededmint("zek", 5) self.assertFalse(self.mntr.issued(id)) self.mntr.registry.registerID(id) self.assertTrue(self.mntr.issued(id)) self.assertTrue(noid.validate(id)) id2 = self.mntr._seededmint("zek", 5) self.assertNotEqual(id, id2) self.assertGreater(len(id2), len(id)) self.assertEqual(id2[-3], '0') self.assertTrue(noid.validate(id2)) self.assertEqual(self.mntr._collision_count, 1)
def test_mint_k(self): self.minter = minter.NoidMinter(self.minter.mask+'k', 0) for val in "0000 0013 0026".split(): id = self.minter.mint() self.assertEqual(id, val) self.assertTrue(noid.validate(id)) self.minter.nextn = 10 id = self.minter.mint() self.assertEqual(id, "00b1") self.assertTrue(noid.validate(id)) self.minter.nextn = 5432 id = self.minter.mint() self.assertEqual(id, "m791") self.assertTrue(noid.validate(id))
def test_validate_valid(self): valid = 'test31wqw0wsr' validScheme = 'ark:/test31wqw0wsr' self.assertTrue(pynoid.validate(valid)) self.assertTrue(pynoid.validate(validScheme))
def test_validate_valid(self): valid = 'test31wqw0wsr' valid_scheme = 'ark:/test31wqw0wsr' self.assertTrue(pynoid.validate(valid)) self.assertTrue(pynoid.validate(valid_scheme))