ContriHUB / E-CP

A CLI tool with a variety of features to help in practicing competitive programming problems
0 stars 14 forks source link

Added warning message in case of missing expected output fle #25

Closed Dadaji18 closed 1 year ago

Dadaji18 commented 1 year ago

Added validation in TestValidator.py that checks whether expected output file for an input file is present in the directory or not. Added functionality to ask user for continuing execution OR stopping execution.

Added another function __show_output in TestValidator.py to show output for the case of missing expected output file

'''Function to show output if expected output file is not present'''
def __show_output(self, output):
    output_lines = output.readlines()
    click.echo(click.style('Code output: ', fg='blue', bold=True))
    click.echo()

    for index in range(len(output_lines)):
        click.echo(click.style(output_lines[index].rstrip(), bg='green', fg='white'))

    click.echo()
akstron commented 1 year ago

Hey, I don't think there is a need for stopping the program and asking for the user to continue when the expected file is missing. We can just say its not there and continue.

Dadaji18 commented 1 year ago

I misunderstood what you said earlier, now it has been sorted.