コード例 #1
0
 def test_random_prefix(self, mock_zid_random):
     """Test we're calling random for prefix."""
     # Have random.choice return determined values
     mock_zid_random.choice.side_effect = ['y', '2', 'k', '9', 'q']
     zid = create_zid(date(2010, 1, 20))
     self._check_zid(zid)
     self.assertEqual(zid[0:5], 'y2k9q')
コード例 #2
0
 def test_jan_13_2146(self):
     """Test after day counter wraps."""
     zid = create_zid(date(2146, 1, 13))
     self.assertEqual(zid[-3:], '000')
     self._check_zid(zid)
コード例 #3
0
 def test_jan_12_2146(self):
     """Test end of day counter range."""
     zid = create_zid(date(2146, 1, 12))
     self.assertEqual(zid[-3:], 'zzz')
     self._check_zid(zid)
コード例 #4
0
 def test_apr_18_2019(self):
     """Test an arbitrary date."""
     zid = create_zid(date(2019, 4, 18))
     self.assertEqual(zid[-3:], '0a5')
     self._check_zid(zid)
コード例 #5
0
 def test_before_start_date(self):
     """Test a date before project started."""
     zid = create_zid(date(2018, 4, 17))
     self.assertEqual(zid[-3:], '001')
     self._check_zid(zid)
コード例 #6
0
 def test_start_date(self):
     """Test for the start date."""
     self.assertEqual(ZK_START_DATE, date(2018, 4, 18))
     zid = create_zid(ZK_START_DATE)
     self.assertEqual(zid[-3:], '000')
     self._check_zid(zid)