mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) move data engine code to core
Summary: this moves sandbox/grist to core, and adds a requirements.txt file for reconstructing the content of sandbox/thirdparty. Test Plan: existing tests pass. Tested core functionality manually. Tested docker build manually. Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2563
This commit is contained in:
29
sandbox/grist/test_functions.py
Normal file
29
sandbox/grist/test_functions.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import doctest
|
||||
import functions
|
||||
import moment
|
||||
|
||||
_old_date_get_global_tz = None
|
||||
|
||||
def date_setUp(doc_test):
|
||||
# pylint: disable=unused-argument
|
||||
global _old_date_get_global_tz # pylint: disable=global-statement
|
||||
_old_date_get_global_tz = functions.date._get_global_tz
|
||||
functions.date._get_global_tz = lambda: moment.tzinfo('America/New_York')
|
||||
|
||||
def date_tearDown(doc_test):
|
||||
# pylint: disable=unused-argument
|
||||
functions.date._get_global_tz = _old_date_get_global_tz
|
||||
|
||||
|
||||
# This works with the unittest module to turn all the doctests in the functions' doc-comments into
|
||||
# unittest test cases.
|
||||
def load_tests(loader, tests, ignore):
|
||||
tests.addTests(doctest.DocTestSuite(functions.date, setUp = date_setUp, tearDown = date_tearDown))
|
||||
tests.addTests(doctest.DocTestSuite(functions.info, setUp = date_setUp, tearDown = date_tearDown))
|
||||
tests.addTests(doctest.DocTestSuite(functions.logical))
|
||||
tests.addTests(doctest.DocTestSuite(functions.math))
|
||||
tests.addTests(doctest.DocTestSuite(functions.stats))
|
||||
tests.addTests(doctest.DocTestSuite(functions.text))
|
||||
tests.addTests(doctest.DocTestSuite(functions.schedule,
|
||||
setUp = date_setUp, tearDown = date_tearDown))
|
||||
return tests
|
||||
Reference in New Issue
Block a user