Exemple #1
0
def test_get_function_set_1(conn):
    with closing(conn.cursor()) as cursor:
        reset_db(cursor)

    conn.commit()

    with closing(conn.cursor()) as cursor:
        get_function_set(cursor, 12)
Exemple #2
0
    def execute(self):
        with closing(self.minerva_context.reader_conn.cursor()) as cursor:
            try:
                function_set = get_function_set(cursor, self.function_set_id)
            except NoSuchFunctionSetError:
                raise JobExecutionError("no function set with id {}".format(
                        self.function_set_id))

        transformation = Transformation(function_set, self.dest_timestamp)
        transformation.execute(self.minerva_context)
Exemple #3
0
def test_get_function_set_2(conn):
    with closing(conn.cursor()) as cursor:
        reset_db(cursor)

    conn.commit()

    with closing(conn.cursor()) as cursor:
        entitytype = get_dummy_entitytype(cursor, "dummy_type")
        src_datasource = get_dummy_datasource(cursor, "dummy-src-1")
        dst_datasource = get_dummy_datasource(cursor, "dummy-src-2")

        args = ("test_set", "", [1, 2, 3], [src_datasource.id], entitytype.id,
                "900", dst_datasource.id, entitytype.id, "900", None, [], None, True)

        function_set = add_function_set(cursor, *args)

        function_set = get_function_set(cursor, function_set.id)

    eq_(function_set.name, 'test_set')