-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/e-mission/e-mission-server
- Loading branch information
Showing
8 changed files
with
217 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
emission/tests/coreTests/wrapperTests/TestUserCustomLabel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from __future__ import division | ||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import absolute_import | ||
# Standard imports | ||
from future import standard_library | ||
standard_library.install_aliases() | ||
from builtins import * | ||
import unittest | ||
|
||
# Our imports | ||
from emission.core.wrapper.user import User | ||
import emission.tests.common as etc | ||
import emission.core.get_database as edb | ||
|
||
import emission.tests.common as etc | ||
|
||
class TestUserCustomMode(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.user = User.register('[email protected]') | ||
|
||
def testInitialGetUserCustomLabels(self): | ||
self.assertListEqual(self.user.getUserCustomLabel('mode'), []) | ||
self.assertListEqual(self.user.getUserCustomLabel('purpose'), []) | ||
|
||
def testInsertCustomLabel(self): | ||
inserted_mode = { | ||
'key' : 'mode', | ||
'label' : 'mode1', | ||
} | ||
mode = self.user.insertUserCustomLabel(inserted_mode) | ||
self.assertListEqual(mode, ['mode1']) | ||
|
||
inserted_purpose = { | ||
'key' : 'purpose', | ||
'label' : 'purpose1', | ||
} | ||
purpose = self.user.insertUserCustomLabel(inserted_purpose) | ||
self.assertListEqual(purpose, ['purpose1']) | ||
|
||
def tesUpdateUserCustomLabel(self): | ||
self.testInsertCustomLabel() | ||
updated_mode = { | ||
'key' : 'mode', | ||
'old_label' : '', | ||
'new_label' : 'mode2', | ||
'is_new_label_must_added': True | ||
} | ||
mode = self.user.updateUserCustomLabel(updated_mode) | ||
self.assertListEqual(mode, ['mode2', 'mode1']) | ||
|
||
updated_purpose = { | ||
'key' : 'purpose', | ||
'old_label' : '', | ||
'new_label' : 'purpose2', | ||
'is_new_label_must_added': True | ||
} | ||
purpose = self.user.updateUserCustomLabel(updated_purpose) | ||
self.assertListEqual(purpose, ['purpose2', 'purpose1']) | ||
|
||
def testDeleteUserCustomMode(self): | ||
self.tesUpdateUserCustomLabel() | ||
deleted_mode = { | ||
'key' : 'mode', | ||
'label' : 'mode2', | ||
} | ||
mode = self.user.deleteUserCustomLabel(deleted_mode) | ||
|
||
self.assertListEqual(mode, ['mode1']) | ||
|
||
deleted_purpose = { | ||
'key' : 'purpose', | ||
'label' : 'purpose2', | ||
} | ||
purpose = self.user.deleteUserCustomLabel(deleted_purpose) | ||
self.assertListEqual(purpose, ['purpose1']) | ||
|
||
def tearDown(self): | ||
etc.dropAllCollections(edb._get_current_db()) | ||
|
||
|
||
if __name__ == '__main__': | ||
etc.configLogging() | ||
unittest.main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ dependencies: | |
- scipy=1.10.0 | ||
- utm=0.7.0 | ||
- pip: | ||
- git+https://github.com/JGreenlee/[email protected].2 | ||
- git+https://github.com/JGreenlee/[email protected].3 | ||
- pyfcm==1.5.4 | ||
- pygeocoder==1.2.5 | ||
- pymongo==4.3.3 | ||
|