コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 def test_05_layer_v1(self):
     """Test Unique.layer_v1()"""
     uniq = udocker.Unique()
     rand = uniq.layer_v1()
     self.assertEqual(len(rand), 64)
コード例 #4
0
 def test_04_imagename(self):
     """Test Unique.imagename()"""
     uniq = udocker.Unique()
     rand = uniq.imagename()
     self.assertEqual(len(rand), 16)
コード例 #5
0
 def test_02_rnd(self):
     """Test Unique._rnd()"""
     uniq = udocker.Unique()
     rand = uniq._rnd(64)
     self.assertIsInstance(rand, str)
     self.assertEqual(len(rand), 64)
コード例 #6
0
 def test_01_init(self):
     """Test Unique() constructor"""
     uniq = udocker.Unique()
     self.assertEqual(uniq.def_name, "udocker")