def __init__(self, config):
     fname = file.normalize(args.rippled)
     if not os.path.exists(fname):
         raise exception('no rippled found at %s.' % fname)
     self.cmd = [fname]
     if args.config:
         self.cmd.extend(['--conf', file.normalize(args.config)])
     self.info = self._command('server_info')['info']
     c = self.info.get('complete_ledgers')
     if c == 'empty':
         self.complete = []
     else:
         self.complete = sorted(range.from_string(c))
 def round_trip(self, s, *items):
     self.assertequals(range.from_string(s), set(items))
     self.assertequals(range.to_string(items), s)
 def test_names(self):
     self.assertequals(
         range.from_string('first,last,current', first=1, last=3, current=5),
         set([1, 3, 5]))