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

Add unit tests for the functions in utils.py #6

Closed
marco-c opened this issue Jan 29, 2018 · 9 comments
Closed

Add unit tests for the functions in utils.py #6

marco-c opened this issue Jan 29, 2018 · 9 comments

Comments

@marco-c
Copy link
Owner

marco-c commented Jan 29, 2018

No description provided.

@skulltech
Copy link
Contributor

@marco-c Which testing framework should we use for this project? I suggest pytest, it's one of the most robust ones out there.

@skulltech
Copy link
Contributor

I can start working on this once we've decided on the framework to use.

@marco-c
Copy link
Owner Author

marco-c commented Feb 6, 2018

👍 for pytest!

@skulltech
Copy link
Contributor

Okay will start working on it ASAP. :D

@marco-c
Copy link
Owner Author

marco-c commented Feb 15, 2018

Since @skulltech already has some experience with the project, it's better if someone else who is just starting takes this on to gain some experience.

@Shashi456
Copy link
Contributor

Can i take this up ?

@marco-c
Copy link
Owner Author

marco-c commented Feb 17, 2018

Sure, go ahead!

@Shashi456
Copy link
Contributor

Shashi456 commented Feb 17, 2018

@marco-c I wanted to know if these are the following unit tests are okay ? And i'm only majorly checking for functions with some parameters

  def test_mkdir():
     direc_path = os.path.dirname(os.path.realpath(__file__)) + "test"
     mkdir(direc_path)
     assert(os.path.exists(direc_path))

  def test_read_labels():
    labels = read_labels(file_name='labels.csv')
    assert('labels' in locals() or 'labels' in globals() )


  def test_write_labels():
    write_labels(label,file_name='test.csv')
    fname = os.path.dirname(os.path.realpath(__file__)) + "\\test.csv"
    assert(os.path.exists(fname)) 

@marco-c
Copy link
Owner Author

marco-c commented Feb 17, 2018

Hey @Shashi456, please write a PR, it's easier to review than a comment in an issue!
For creating directories and files, I suggest you put everything in a temporary directory (you can use the tempfile library) and clean everything at the end of the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants