def test_03_uuid(self): """Test Unique.uuid()""" uniq = udocker.Unique() rand = uniq.uuid("zxcvbnm") self.assertEqual(len(rand), 36) rand = uniq.uuid(789) self.assertEqual(len(rand), 36)
def test_06_filename(self): """Test Unique.filename()""" uniq = udocker.Unique() rand = uniq.filename("zxcvbnmasdf") self.assertTrue(rand.endswith("zxcvbnmasdf")) self.assertTrue(rand.startswith("udocker")) self.assertGreater(len(rand.strip()), 56) rand = uniq.filename(12345) self.assertTrue(rand.endswith("12345")) self.assertTrue(rand.startswith("udocker")) self.assertGreater(len(rand.strip()), 50)
def test_05_layer_v1(self): """Test Unique.layer_v1()""" uniq = udocker.Unique() rand = uniq.layer_v1() self.assertEqual(len(rand), 64)
def test_04_imagename(self): """Test Unique.imagename()""" uniq = udocker.Unique() rand = uniq.imagename() self.assertEqual(len(rand), 16)
def test_02_rnd(self): """Test Unique._rnd()""" uniq = udocker.Unique() rand = uniq._rnd(64) self.assertIsInstance(rand, str) self.assertEqual(len(rand), 64)
def test_01_init(self): """Test Unique() constructor""" uniq = udocker.Unique() self.assertEqual(uniq.def_name, "udocker")