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 TL module and fix some bugs #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lds56
Copy link
Contributor

@lds56 lds56 commented Apr 21, 2015

Changes

Issue

I choose nose as the test tool and it works well with python2.7. However, using nose with python3 can be a little troublesome. Of course, the unit tests themselves are okay for either py2 or py3 so you can run the tests in other way you like.

@awesomebytes
Copy link
Collaborator

Dude, you are the boss! Than you for the effort!!

I'm personally not experienced in python testing so I appreciate it a lot :)
On Apr 21, 2015 8:59 AM, "Rui Chen" [email protected] wrote:

Changes

Issue

I choose nose https://nose.readthedocs.org/en/latest/ as the test
tool and it works well with python2.7. However, using nose with python3 can
be a little troublesome https://nose.readthedocs.org/en/latest/#python3.
Of course, the unit tests themselves are okay for either py2 or py3 so you

can run the tests in other way you like.

You can view, comment on, or merge this pull request online at:

https://github.com/griganton/telepy/pull/7
Commit Summary

  • fix JSON loading fix bug
  • add unittest for TL module

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
https://github.com/griganton/telepy/pull/7.

@lds56
Copy link
Contributor Author

lds56 commented Apr 21, 2015

I'm happy as well for hearing that it can be of help 😊

@@ -63,7 +68,8 @@ def __init__(self, filename):


## Loading TL_schema (should be placed in the same directory as mtproto.py
tl = TL(os.path.join(os.path.dirname(__file__), "TL_schema.JSON"))
tl = TL(os.path.join(os.path.abspath(os.path.dirname(__file__)), "TL_schema.JSON"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original statement caused nothing wrong actually. But when I printed os.path.dirname(__file__) out I got nothing but a blank line. Therefore, I appended os.path.abspath for ensuring loading json correctly.

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

Successfully merging this pull request may close these issues.

3 participants