Example #1
0
 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))
Example #2
0
 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))
Example #3
0
 def round_trip(self, s, *items):
     self.assertEquals(Range.from_string(s), set(items))
     self.assertEquals(Range.to_string(items), s)
Example #4
0
 def test_names(self):
     self.assertEquals(
         Range.from_string('first,last,current', first=1, last=3,
                           current=5), set([1, 3, 5]))
Example #5
0
 def round_trip(self, s, *items):
     self.assertEquals(Range.from_string(s), set(items))
     self.assertEquals(Range.to_string(items), s)
Example #6
0
 def test_names(self):
     self.assertEquals(
         Range.from_string('first,last,current', first=1, last=3, current=5),
         set([1, 3, 5]))