예제 #1
0
 def testOneOfEveryNExportVersionsZero(self):
   # Zero is a special case since it gets rolled into the first interval.
   # Test that here.
   paths = [gc.Path("/foo", 0), gc.Path("/foo", 4), gc.Path("/foo", 5)]
   one_of = gc.one_of_every_n_export_versions(3)
   self.assertEquals(one_of(paths),
                     [gc.Path("/foo", 0), gc.Path("/foo", 5)])
예제 #2
0
파일: gc_test.py 프로젝트: zhmz90/serving
 def testOneOfEveryNExportVersionsZero(self):
     # Zero is a special case since it gets rolled into the first interval.
     # Test that here.
     paths = [gc.Path("/foo", 0), gc.Path("/foo", 4), gc.Path("/foo", 5)]
     one_of = gc.one_of_every_n_export_versions(3)
     self.assertEquals(
         one_of(paths),
         [gc.Path("/foo", 0), gc.Path("/foo", 5)])
예제 #3
0
 def testOneOfEveryNExportVersions(self):
   paths = [gc.Path("/foo", 0), gc.Path("/foo", 1), gc.Path("/foo", 3),
            gc.Path("/foo", 5), gc.Path("/foo", 6), gc.Path("/foo", 7),
            gc.Path("/foo", 8), gc.Path("/foo", 33)]
   one_of = gc.one_of_every_n_export_versions(3)
   self.assertEquals(one_of(paths),
                     [gc.Path("/foo", 3), gc.Path("/foo", 6),
                      gc.Path("/foo", 8), gc.Path("/foo", 33)])
예제 #4
0
파일: gc_test.py 프로젝트: zhmz90/serving
 def testOneOfEveryNExportVersions(self):
     paths = [
         gc.Path("/foo", 0),
         gc.Path("/foo", 1),
         gc.Path("/foo", 3),
         gc.Path("/foo", 5),
         gc.Path("/foo", 6),
         gc.Path("/foo", 7),
         gc.Path("/foo", 8),
         gc.Path("/foo", 33)
     ]
     one_of = gc.one_of_every_n_export_versions(3)
     self.assertEquals(one_of(paths), [
         gc.Path("/foo", 3),
         gc.Path("/foo", 6),
         gc.Path("/foo", 8),
         gc.Path("/foo", 33)
     ])