MCPcopy Create free account
hub / github.com/ceph/ceph / setUp

Method setUp

src/test/pybind/test_ceph_argparse.py:1289–1310  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1287 MIXED = 3
1288
1289 def setUp(self):
1290 self.prefix = ['some', 'random', 'cmd']
1291 self.args_dict = [
1292 {'name': 'variable_one', 'type': 'CephString'},
1293 {'name': 'variable_two', 'type': 'CephString'},
1294 {'name': 'variable_three', 'type': 'CephString'},
1295 {'name': 'variable_four', 'type': 'CephInt'},
1296 {'name': 'variable_five', 'type': 'CephString'}]
1297 self.args = []
1298 for d in self.args_dict:
1299 if d['type'] == 'CephInt':
1300 val = "{}".format(random.randint(0, 100))
1301 elif d['type'] == 'CephString':
1302 letters = string.ascii_letters
1303 str_len = random.randint(5, 10)
1304 val = ''.join(random.choice(letters) for _ in range(str_len))
1305 else:
1306 raise skipTest()
1307
1308 self.args.append((d['name'], val))
1309
1310 self.sig = parse_funcsig(self.prefix + self.args_dict)
1311
1312 def _arg_kwarg_test(self, prefix, args, sig, arg_type=0):
1313 """

Callers

nothing calls this directly

Calls 4

parse_funcsigFunction · 0.90
formatMethod · 0.45
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected