Exemple #1
0
    def test_load(self):
        state = {}
        with HTTMock(create_mock(state)):
            url = 'file:///foo.bar'
            relation = MyriaRelation(FULL_NAME, connection=self.connection)
            relation.load(url, schema=MyriaSchema(SCHEMA))
            plan = relation._sink().to_json()
            text = json.dumps(plan['plan']['fragments'][1]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)

            relation.execute()
            plan = state['query']
            text = json.dumps(plan['plan']['fragments'][0]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)
    def test_load(self):
        state = {}
        with HTTMock(create_mock(state)):
            url = 'file:///foo.bar'
            relation = MyriaRelation(FULL_NAME, connection=self.connection)
            relation.load(url, schema=MyriaSchema(SCHEMA))
            plan = relation._sink().to_json()
            text = json.dumps(plan['plan']['fragments'][1]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)

            relation.execute()
            plan = state['query']
            text = json.dumps(plan['plan']['fragments'][0]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)