-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add load_default_settings_files function
- Loading branch information
1 parent
6cb239a
commit f9db6f2
Showing
2 changed files
with
35 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,44 @@ | ||
# -*- coding: utf-8 -*- | ||
from .helper import session | ||
|
||
import os.path as osp | ||
from mathicsscript import load_default_settings_files | ||
|
||
from mathics.core.definitions import autoload_files, Definitions | ||
|
||
def test_settings(): | ||
import os.path as osp | ||
from mathics.core.definitions import autoload_files | ||
import mathicsscript | ||
load_default_settings_files(session.definitions) | ||
|
||
root_dir = osp.realpath( | ||
osp.dirname(mathicsscript.__file__), | ||
assert ( | ||
session.evaluate("Settings`$ShowFullFormInput::usage").to_python() | ||
!= "Settings`$ShowFullFormInput::usage" | ||
) | ||
|
||
autoload_files(session.definitions, root_dir, "autoload") | ||
|
||
assert session.evaluate("Settings`$ShowFullFormInput::usage").to_python() != "Settings`$ShowFullFormInput::usage" | ||
|
||
assert type(session.evaluate("Settings`$ShowFullFormInput").to_python()) is bool | ||
|
||
assert session.evaluate("Settings`$PygmentsStyle::usage").to_python() != "Settings`$PygmentsStyle::usage" | ||
assert ( | ||
session.evaluate("Settings`$PygmentsStyle::usage").to_python() | ||
!= "Settings`$PygmentsStyle::usage" | ||
) | ||
|
||
assert session.evaluate("Settings`$PygmentsShowTokens::usage").to_python() != "Settings`$PygmentsShowTokens::usage" | ||
assert ( | ||
session.evaluate("Settings`$PygmentsShowTokens::usage").to_python() | ||
!= "Settings`$PygmentsShowTokens::usage" | ||
) | ||
|
||
assert type(session.evaluate("Settings`$PygmentsShowTokens").to_python()) is bool | ||
|
||
assert session.evaluate("Settings`$UseUnicode::usage").to_python() != "Settings`$UseUnicode::usage" | ||
assert ( | ||
session.evaluate("Settings`$UseUnicode::usage").to_python() | ||
!= "Settings`$UseUnicode::usage" | ||
) | ||
|
||
assert type(session.evaluate("Settings`$UseUnicode").to_python()) is bool | ||
|
||
assert session.evaluate("Settings`MathicsScriptVersion::usage").to_python() != "Settings`MathicsScriptVersion::usage" | ||
assert ( | ||
session.evaluate("Settings`MathicsScriptVersion::usage").to_python() | ||
!= "Settings`MathicsScriptVersion::usage" | ||
) | ||
|
||
|
||
def test_is_not_notebook(): | ||
# the settings already were loaded | ||
# the settings already were loaded | ||
assert session.evaluate("System`$Notebooks").to_python() == False |