Cases Test in assignments...

21 views
Skip to first unread message

Alejandro Garcia Ruiz

unread,
Sep 1, 2022, 4:00:03 PM9/1/22
to Runestone Dev
Hello
I am creating assignments in runestone, I want to put test cases that read the input data from a file to work in the Python program and compare the output with a test case, can someone recommend me which is the best option?

Bradley Miller

unread,
Sep 1, 2022, 4:08:46 PM9/1/22
to Runestone Dev
Hi Alejandro,

You will need to write a question using the ‘datafile’ type.  The unique id you use for the datafile directive is the name to use as the filename in the code/test code.

Brad

Bradley Miller, PhD
Professor Emeritus Computer Science
Luther College
Founder, Runestone Academy
Blog: A Reputable Journal
On Sep 1, 2022, 3:00 PM -0500, 'Alejandro Garcia Ruiz' via Runestone Dev <runestonei...@googlegroups.com>, wrote:
Hello
I am creating assignments in runestone, I want to put test cases that read the input data from a file to work in the Python program and compare the output with a test case, can someone recommend me which is the best option?

--
You received this message because you are subscribed to the Google Groups "Runestone Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to runestoneinterac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/runestoneinteractive/92b56ed3-66c9-430b-8013-5ba72544eddan%40googlegroups.com.

Alejandro García Ruíz

unread,
Sep 1, 2022, 7:11:20 PM9/1/22
to runestonei...@googlegroups.com

Thank you very much for your answer.

 

Is it possible if you have an example that you can share with me?

 

Regards

 

Ing. Alejandro García Ruiz

Director de Carrera IMT

Escuela de IngenieríaCampus Laguna

Tecnológico de Monterrey

Tel (+52) 871 729-6315 ext. 4222

Enlace Intercampus: 80 524 4222

alejandro....@tec.mx

www.lag.itesm.mx

El contenido de este mensaje de datos no se considera oferta, propuesta o acuerdo, sino hasta que sea confirmado en documento por escrito que contenga la firma autógrafa del apoderado legal del ITESM. El contenido de este mensaje de datos es confidencial y se entiende dirigido y para uso de ningún medio sin la previa autorización del emisor original. Si usted no es el destinatario, se le prohíbe su utilización total o parcial para cualquier fin.

The content of this data transmission must not be considered an offer, proposal, understanding or agreement unless it is confirmed in a document signed by a legal representative of ITESM. The content of this data transmission is confidential and is intended to be delivered only to the addressees. Therefore, it shall not be distributed and/or disclosed through any means without the authorization of the original sender. If you are not the addressee, you are forbidden from using it, either totally or partially, for any purpose.

Bradley Miller

unread,
Sep 1, 2022, 7:24:18 PM9/1/22
to runestonei...@googlegroups.com
Please check out our Overview book The image processing example shows how to include a binary file.  The assignment page gives you a template if you choose datafile from the menu.  It may not be obvious that the body of a datafile is where you put in the data which you will have to do if you are using the web interface to create a question

.. datafile:: identifier
   :options:

  Data goes here indented to the level of the first : in options.


Brad

Bradley Miller, PhD
Professor Emeritus Computer Science
Luther College
Founder, Runestone Academy
Blog: A Reputable Journal

Alejandro García Ruíz

unread,
Sep 2, 2022, 11:02:38 AM9/2/22
to runestonei...@googlegroups.com
Dear Brad, thanks a lot for your advice. I’ll check overview book.

I another question, an assignment in is it possible to use test checking input and output files, instead of unittest?

Send from my iPhone

Ing. Alejandro García Ruiz 
Director de Carrera IMT

División de Profesional

Campus Laguna
TECNOLÓGICO DE MONTERREY

alejandro....@itesm.mx

www.itesm.edu


Tel. (+52) 871 729 63 15 ext. 4222

Fax 871 729 63 15
Enlace intercampus 80 524 4422


On Sep 1, 2022, at 18:24, Bradley Miller <br...@runestone.academy> wrote:



Bradley Miller

unread,
Sep 2, 2022, 11:39:17 AM9/2/22
to runestonei...@googlegroups.com
I don’t think I understand your question.  The benefit of using the unittest framework is that it is built into our grading system.  You can make a unit test do anything you can do with Python including checking the contents of files or checking standard output or even inspecting at the code.

Brad

Bradley Miller, PhD
Professor Emeritus Computer Science
Luther College
Founder, Runestone Academy
Blog: A Reputable Journal
Reply all
Reply to author
Forward
0 new messages