示例#1
0
 def testModExportVersion(self):
   paths = [gc.Path("/foo", 4), gc.Path("/foo", 5), gc.Path("/foo", 6),
            gc.Path("/foo", 9)]
   mod = gc.mod_export_version(2)
   self.assertEquals(mod(paths), [gc.Path("/foo", 4), gc.Path("/foo", 6)])
   mod = gc.mod_export_version(3)
   self.assertEquals(mod(paths), [gc.Path("/foo", 6), gc.Path("/foo", 9)])
示例#2
0
 def testModExportVersion(self):
   paths = [gc.Path("/foo", 4), gc.Path("/foo", 5), gc.Path("/foo", 6),
            gc.Path("/foo", 9)]
   mod = gc.mod_export_version(2)
   self.assertEquals(mod(paths), [gc.Path("/foo", 4), gc.Path("/foo", 6)])
   mod = gc.mod_export_version(3)
   self.assertEquals(mod(paths), [gc.Path("/foo", 6), gc.Path("/foo", 9)])
示例#3
0
 def testNegation(self):
   paths = [gc.Path("/foo", 4), gc.Path("/foo", 5), gc.Path("/foo", 6),
            gc.Path("/foo", 9)]
   mod = gc.negation(gc.mod_export_version(2))
   self.assertEquals(
       mod(paths), [gc.Path("/foo", 5), gc.Path("/foo", 9)])
   mod = gc.negation(gc.mod_export_version(3))
   self.assertEquals(
       mod(paths), [gc.Path("/foo", 4), gc.Path("/foo", 5)])
示例#4
0
 def testNegation(self):
   paths = [gc.Path("/foo", 4), gc.Path("/foo", 5), gc.Path("/foo", 6),
            gc.Path("/foo", 9)]
   mod = gc.negation(gc.mod_export_version(2))
   self.assertEquals(
       mod(paths), [gc.Path("/foo", 5), gc.Path("/foo", 9)])
   mod = gc.negation(gc.mod_export_version(3))
   self.assertEquals(
       mod(paths), [gc.Path("/foo", 4), gc.Path("/foo", 5)])
示例#5
0
 def testUnion(self):
   paths = []
   for i in xrange(10):
     paths.append(gc.Path("/foo", i))
   f = gc.union(gc.largest_export_versions(3), gc.mod_export_version(3))
   self.assertEquals(
       f(paths), [gc.Path("/foo", 0), gc.Path("/foo", 3),
                  gc.Path("/foo", 6), gc.Path("/foo", 7),
                  gc.Path("/foo", 8), gc.Path("/foo", 9)])
示例#6
0
 def testUnion(self):
   paths = []
   for i in xrange(10):
     paths.append(gc.Path("/foo", i))
   f = gc.union(gc.largest_export_versions(3), gc.mod_export_version(3))
   self.assertEquals(
       f(paths), [gc.Path("/foo", 0), gc.Path("/foo", 3),
                  gc.Path("/foo", 6), gc.Path("/foo", 7),
                  gc.Path("/foo", 8), gc.Path("/foo", 9)])