Example #1
0
 def test_list(self):
     with helpers.partitions(self.controller, 10) as expect:
         values = zip(self.controller.list(), expect)
         for p, x in values:
             n, w, h = x
             self._check_structure(p)
             self._check_values(p, xname=n, xweight=w, xhosts=h)
Example #2
0
 def test_list(self):
     with helpers.partitions(self.controller, 10) as expect:
         values = zip(self.controller.list(), expect)
         for p, x in values:
             n, w, h = x
             self._check_structure(p)
             self._check_values(p, xname=n, xweight=w, xhosts=h)
Example #3
0
    def test_partition_life_cycle(self):
        # check listing is initially empty
        for p in self.controller.list():
            self.fail('There should be no partitions at this time')

        # create a listing, check its length
        with helpers.partitions(self.controller, 10):
            ps = list(self.controller.list())
            self.assertEqual(len(ps), 10)

        # create, check existence, delete
        with helpers.partition(self.controller, self.name, 1, ['a']):
            self.assertTrue(self.controller.exists(self.name))

        # verify it no longer exists
        self.assertFalse(self.controller.exists(self.name))

        # verify it isn't listable
        self.assertEqual(len(list(self.controller.list())), 0)
Example #4
0
    def test_partition_life_cycle(self):
        # check listing is initially empty
        for p in self.controller.list():
            self.fail('There should be no partitions at this time')

        # create a listing, check its length
        with helpers.partitions(self.controller, 10):
            ps = list(self.controller.list())
            self.assertEqual(len(ps), 10)

        # create, check existence, delete
        with helpers.partition(self.controller, self.name, 1, ['a']):
            self.assertTrue(self.controller.exists(self.name))

        # verify it no longer exists
        self.assertFalse(self.controller.exists(self.name))

        # verify it isn't listable
        self.assertEqual(len(list(self.controller.list())), 0)