Exemplo n.º 1
0
    def testAddTargetAndGetAllTargets(self):
        hashSpace = Flexihash()
        hashSpace \
            .addTarget('t-a') \
            .addTarget('t-b') \
            .addTarget('t-c')

        self.assertEqual(hashSpace.getAllTargets(), ['t-a', 't-b', 't-c'])
Exemplo n.º 2
0
    def testAddTargetAndGetAllTargets(self):
        hashSpace = Flexihash()
        hashSpace \
            .addTarget('t-a') \
            .addTarget('t-b') \
            .addTarget('t-c')

        self.assertEqual(hashSpace.getAllTargets(), ['t-a', 't-b', 't-c'])
Exemplo n.º 3
0
    def testAddTargetsAndGetAllTargets(self):
        targets = ['t-a', 't-b', 't-c']

        hashSpace = Flexihash()
        hashSpace.addTargets(targets)
        self.assertEqual(hashSpace.getAllTargets(), targets)
Exemplo n.º 4
0
 def testGetAllTargetsEmpty(self):
     hashSpace = Flexihash()
     self.assertEqual(hashSpace.getAllTargets(), [])
Exemplo n.º 5
0
    def testAddTargetsAndGetAllTargets(self):
        targets = ['t-a', 't-b', 't-c']

        hashSpace = Flexihash()
        hashSpace.addTargets(targets)
        self.assertEqual(hashSpace.getAllTargets(), targets)
Exemplo n.º 6
0
 def testGetAllTargetsEmpty(self):
     hashSpace = Flexihash()
     self.assertEqual(hashSpace.getAllTargets(), [])