add User tests for UserManager.py#868
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. |
| class Test(unittest.TestCase): | ||
|
|
||
| def test_check_existing_username(self): | ||
| self.assertEqual(True,check_user_name('rand')) |
There was a problem hiding this comment.
Can you use something like PyCharm's auto formatter to format these files.
We can do this in few ways:
|
| "dependencies": { | ||
| "jasmine-core": "^2.5.2" | ||
| "fsevents": "^2.1.2", | ||
| "gyp": "^0.5.0", |
There was a problem hiding this comment.
why did the package.json changed for python tests?
There was a problem hiding this comment.
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 |
JaDogg
left a comment
There was a problem hiding this comment.
Can you change the file to user_tests.py
| import testing.mysqld | ||
|
|
||
| # Generate Mysqld class which shares the generated database | ||
| Mysqld = testing.mysqld.MysqldFactory(cache_initialized_db=True) |
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.
Duplicate import statement. Same as in line no:4.
| suite = unittest.TestLoader().loadTestsFromTestCase(Test) | ||
| unittest.TextTestRunner(verbosity=2).run(suite) | ||
|
|
||
|
|
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: