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 __init__(self): 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', _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]))