Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added File IO Testing #1096

Merged
merged 3 commits into from
May 9, 2019
Merged

Added File IO Testing #1096

merged 3 commits into from
May 9, 2019

Conversation

auroq
Copy link
Contributor

@auroq auroq commented May 7, 2019

Congrats on taking the first step to contributing to the Sample Programs repository maintained by The Renegade Coder! For simplicity, please make sure that your pull request includes one and only one contribution.

Complete the Applicable Sections Below

Find which section best describes your pull request and make sure you fill it out. To start, let us know which issue you've fixed.

  • I fixed #your-issue-number-here

Code Snippets

  • I named the pull request using Added/Updated <Sample Program> in <Language> format
  • I created/updated the language README
    • I added the sample program name to the README
    • I added fun facts (i.e. debut, developer, typing, etc.)
    • I added reference link(s) to the README
    • I added solution citations when necessary (see plagiarism)

Documentation

  • I named the pull request using Added/Updated <Sample Program> in <Language> Article format
  • I followed the applicable article template

Testing

  • I names the pull request using Added/Updated <Language>/<Project> Testing format
  • I followed the testinfo template, if applicable

Notes

Feel free to describe what you added or updated.

@auroq auroq added file input output See: https://sampleprograms.io/projects/file-input-output/ tests Testing related labels May 7, 2019
@auroq auroq added this to the 25 Project Tests milestone May 7, 2019
@auroq
Copy link
Contributor Author

auroq commented May 7, 2019

In order to test File IO, I needed access to the output.txt file that is created at runtime, meaning that I needed access to the container itself.
In order to do that I added an exec method to Source, but I'm worried that could be abused. If we want to prevent abuse, I can get rid of the exec() method and replace it with a more specific get_file_text() method.

test/projects/test_file_io.py Outdated Show resolved Hide resolved
@jrg94 jrg94 self-assigned this May 8, 2019
@jrg94 jrg94 requested a review from a team May 8, 2019 19:29
@jrg94
Copy link
Member

jrg94 commented May 8, 2019

Random idea: do you think it makes sense to pull your testing code out into its own repo? I was thinking it might be beneficial to start versioning your work and maybe even pip package it.

I can make a separate repo under The Renegade Coder (or you can use your own if you'd like).

@auroq
Copy link
Contributor Author

auroq commented May 9, 2019

Random idea: do you think it makes sense to pull your testing code out into its own repo? I was thinking it might be beneficial to start versioning your work and maybe even pip package it.

I can make a separate repo under The Renegade Coder (or you can use your own if you'd like).

That is something I have been considering as well.

Since it was originally pushed here, it is property of TheRenegadeCoder. However, with your consent, I would love to take ownership of it under my own name (but using the MIT license).

@jrg94
Copy link
Member

jrg94 commented May 9, 2019

Yeah, go for it! It's all your work after all. That way you can give it a cool name and whatnot. 👍

@jrg94
Copy link
Member

jrg94 commented May 9, 2019

I actually just used this GitHub tutorial today to create a new repo with all the history maintained (for a separate project).

Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this to the mix!

@jrg94 jrg94 merged commit 82214bc into master May 9, 2019
@jrg94 jrg94 deleted the test_fileio branch May 9, 2019 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file input output See: https://sampleprograms.io/projects/file-input-output/ tests Testing related
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants