-
-
Notifications
You must be signed in to change notification settings - Fork 494
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 User tests for UserManager.py #868
base: develop
Are you sure you want to change the base?
Conversation
@JaDogg please review this and tell me any necessary changes that need to be made in further tests. Also for writing future tests I was thinking of making a mock db. Please give your suggestions. |
components/core/tests/User_tests.py
Outdated
class Test(unittest.TestCase): | ||
|
||
def test_check_existing_username(self): | ||
self.assertEqual(True,check_user_name('rand')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use something like PyCharm's auto formatter to format these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay i will do that!
We can do this in few ways:
|
@@ -42,7 +42,11 @@ | |||
} | |||
], | |||
"dependencies": { | |||
"jasmine-core": "^2.5.2" | |||
"fsevents": "^2.1.2", | |||
"gyp": "^0.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did the package.json changed for python tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these have come during the setup of the frontend. these packages were somewhat required to complete the setup otherwise a few errors were flashing. any suggestions are most welcome.
we can also checkout |
Will that work in Travis-CI 🤔 if so go ahead. |
@JaDogg I have integrated testing.mysqld module and it passes the travis-CI test given your permission I will implement this on the upcoming and the existing tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the file to user_tests.py
components/core/tests/User_tests.py
Outdated
import testing.mysqld | ||
|
||
# Generate Mysqld class which shares the generated database | ||
Mysqld = testing.mysqld.MysqldFactory(cache_initialized_db=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to MYSQLD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I will!
Sure! |
@JaDogg can you please help me with something I am not able to pass the token generated from the login test function inside a test class to subsequent test functions. Please suggest me away to to that. |
@JaDogg I have added a few changes that make the running of tests look better and more manageable and elaborate. |
@JaDogg Can you please tell me if there are any issues with this pr or is it good enough to be approved? |
import Models | ||
|
||
|
||
import unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate import statement. Same as in line no:4.
suite = unittest.TestLoader().loadTestsFromTestCase(Test) | ||
unittest.TextTestRunner(verbosity=2).run(suite) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unwanted new line.
Description
added tests for adding, removing and updatinng both normal and regular user for UserManager.py
#851
Motivation and Context
this will enhance testing for existing helper functions
after integrating with testing.mysqld
the existing tests
in UserManager.py
How Has This Been Tested?
Screenshots (In case of UI changes):
Types of changes
Checklist: