Esempio n. 1
0
 def test_get_bnum_high_percentage(self):
     '''
     Tests passing batch value as percentage over 100%
     '''
     self.batch.opts = {'batch': '160%', 'timeout': 5}
     self.batch.minions = ['foo', 'bar', 'baz']
     self.assertEqual(Batch.get_bnum(self.batch), 4)
Esempio n. 2
0
 def test_get_bnum(self):
     '''
     Tests passing batch value as a number
     '''
     self.batch.opts = {'batch': '2', 'timeout': 5}
     self.batch.minions = ['foo', 'bar']
     self.assertEqual(Batch.get_bnum(self.batch), 2)
Esempio n. 3
0
 def test_get_bnum_percentage(self):
     '''
     Tests passing batch value as percentage
     '''
     self.batch.opts = {'batch': '50%', 'timeout': 5}
     self.batch.minions = ['foo']
     self.assertEqual(Batch.get_bnum(self.batch), 1)
Esempio n. 4
0
 def test_get_bnum_percentage(self):
     """
     Tests passing batch value as percentage
     """
     self.batch.opts = {"batch": "50%", "timeout": 5}
     self.batch.minions = ["foo"]
     self.assertEqual(Batch.get_bnum(self.batch), 1)
Esempio n. 5
0
 def test_get_bnum_high_percentage(self):
     """
     Tests passing batch value as percentage over 100%
     """
     self.batch.opts = {"batch": "160%", "timeout": 5}
     self.batch.minions = ["foo", "bar", "baz"]
     self.assertEqual(Batch.get_bnum(self.batch), 4)
Esempio n. 6
0
 def test_get_bnum_int(self):
     """
     Tests passing batch value as a number(int)
     """
     self.batch.opts = {"batch": 2, "timeout": 5}
     self.batch.minions = ["foo", "bar"]
     self.assertEqual(Batch.get_bnum(self.batch), 2)
Esempio n. 7
0
 def test_get_bnum_high_percentage(self):
     '''
     Tests passing batch value as percentage over 100%
     '''
     self.batch.opts = {'batch': '160%', 'timeout': 5}
     self.batch.minions = ['foo', 'bar', 'baz']
     self.assertEqual(Batch.get_bnum(self.batch), 4)
Esempio n. 8
0
 def test_get_bnum_percentage(self):
     '''
     Tests passing batch value as percentage
     '''
     self.batch.opts = {'batch': '50%', 'timeout': 5}
     self.batch.minions = ['foo']
     self.assertEqual(Batch.get_bnum(self.batch), 1)
Esempio n. 9
0
 def test_get_bnum(self):
     '''
     Tests passing batch value as a number
     '''
     self.batch.opts = {'batch': '2', 'timeout': 5}
     self.batch.minions = ['foo', 'bar']
     self.assertEqual(Batch.get_bnum(self.batch), 2)
Esempio n. 10
0
 def test_get_bnum_invalid_batch_data(self):
     '''
     Tests when an invalid batch value is passed
     '''
     ret = Batch.get_bnum(self.batch)
     self.assertEqual(ret, None)
Esempio n. 11
0
 def test_get_bnum_invalid_batch_data(self):
     '''
     Tests when an invalid batch value is passed
     '''
     ret = Batch.get_bnum(self.batch)
     self.assertEqual(ret, None)