Ejemplo n.º 1
0
def execute_new_frame_command(command_name, arguments):
    """Executes command and creates a new Frame object from server response"""
    #support for non-plugin methods that may not supply the full name
    if not command_name.startswith('frame'):
        command_name = 'frame/' + command_name
    command_request = CommandRequest(command_name, arguments)
    command_info = executor.issue(command_request)
    frame_info = FrameInfo(command_info.result)
    return Frame(_info=frame_info)
Ejemplo n.º 2
0
 def test_create_from_csv(self, patched_be):
     connect()
     f = Frame(CsvFile("dummy.csv", [('A', int32), ('B', int64)]))
     self.assertEqual(0, len(f))
     try:
         c = f['C']
         self.fail()
     except KeyError:
         pass
Ejemplo n.º 3
0
 def get_frame_by_uri(self, uri):
     logger.info("REST Backend: get_frame_by_uri")
     if uri is None:
         return None
     else:
         r = self.server.get(uri)
         payload = r.json()
         frame = Frame(_info=payload)
         return frame
Ejemplo n.º 4
0
 def get_frame_by_id(self, id):
     logger.info("REST Backend: get_frame_by_id")
     if id is None:
         return None
     else:
         r = self.server.get('frames/' + str(id))
         payload = r.json()
         frame = Frame(_info=payload)
         return frame
Ejemplo n.º 5
0
def get_simple_frame_abfgh():
    schema = [('A', int32),  ('B', int64), ('F', float32), ('G', float64), ('H', str)]
    f = Frame(CsvFile("dummy.csv", schema))
    connect()
    try:
        del _BaseFrame.schema
    except:
        pass
    setattr(f, "schema", schema)
    return f
Ejemplo n.º 6
0
 def test_create(self, patched_be):
     connect()
     f = Frame()
     self.assertEqual(None, f.uri)
Ejemplo n.º 7
0
 def test_create(self, patched_be):
     connect()
     f = Frame()
     self.assertEqual(0, f._id)
     self.assertEqual(None, f._error_frame_id)