"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "client/tests/configuration_test.py" between
pyre-check-0.0.51.tar.gz and pyre-check-0.0.52.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

configuration_test.py  (pyre-check-0.0.51):configuration_test.py  (pyre-check-0.0.52)
skipping to change at line 325 skipping to change at line 325
{ {
"taint_models_path": ".pyre/taint_models", "taint_models_path": ".pyre/taint_models",
"search_path": "simple_string/", "search_path": "simple_string/",
"version": "VERSION", "version": "VERSION",
"typeshed": "/TYPE/%V/SHED/", "typeshed": "/TYPE/%V/SHED/",
}, },
{}, {},
] ]
configuration = Configuration("") configuration = Configuration("")
self.assertEqual(configuration.typeshed, "/TYPE/VERSION/SHED/") self.assertEqual(configuration.typeshed, "/TYPE/VERSION/SHED/")
self.assertEqual(configuration.search_path, ["/root/simple_string/"] ) self.assertEqual(configuration.search_path, ["simple_string/"])
self.assertEqual( self.assertEqual(
configuration.taint_models_path, ["/root/.pyre/taint_models"] configuration.taint_models_path, ["/root/.pyre/taint_models"]
) )
json_load.side_effect = [ json_load.side_effect = [
{ {
"taint_models_path": ".pyre/taint_models", "taint_models_path": ".pyre/taint_models",
"source_directories": ["."], "source_directories": ["."],
}, },
{ {
"search_path": "simple_string/", "search_path": "simple_string/",
"version": "VERSION", "version": "VERSION",
"typeshed": "/TYPE/%V/SHED/", "typeshed": "/TYPE/%V/SHED/",
}, },
] ]
configuration = Configuration( configuration = Configuration(
project_root="/root", local_root="/root/local" project_root="/root", local_root="/root/local"
) )
self.assertEqual(configuration.typeshed, "/TYPE/VERSION/SHED/") self.assertEqual(configuration.typeshed, "/TYPE/VERSION/SHED/")
self.assertEqual(configuration.search_path, ["/root/simple_string/"] ) self.assertEqual(configuration.search_path, ["simple_string/"])
self.assertEqual( self.assertEqual(
configuration.taint_models_path, ["/root/local/.pyre/taint_model s"] configuration.taint_models_path, ["/root/local/.pyre/taint_model s"]
) )
json_load.side_effect = [ json_load.side_effect = [
{ {
"taint_models_path": ".pyre/taint_models", "taint_models_path": ".pyre/taint_models",
"source_directories": ["."], "source_directories": ["."],
}, },
{ {
"search_path": "simple_string/", "search_path": "simple_string/",
"version": "VERSION", "version": "VERSION",
"taint_models_path": "global/taint_models", "taint_models_path": "global/taint_models",
"typeshed": "/TYPE/%V/SHED/", "typeshed": "/TYPE/%V/SHED/",
}, },
] ]
configuration = Configuration( configuration = Configuration(
project_root="/root", local_root="/root/local" project_root="/root", local_root="/root/local"
) )
self.assertEqual(configuration.typeshed, "/TYPE/VERSION/SHED/") self.assertEqual(configuration.typeshed, "/TYPE/VERSION/SHED/")
self.assertEqual(configuration.search_path, ["/root/simple_string/"] ) self.assertEqual(configuration.search_path, ["simple_string/"])
self.assertEqual( self.assertEqual(
configuration.taint_models_path, configuration.taint_models_path,
["/root/local/.pyre/taint_models", "/root/global/taint_models"], ["/root/local/.pyre/taint_models", "/root/global/taint_models"],
) )
json_load.side_effect = [ json_load.side_effect = [
{ {
"search_path": "simple_string/", "search_path": "simple_string/",
"version": "VERSION", "version": "VERSION",
"typeshed": "/TYPE/%V/SHED/", "typeshed": "/TYPE/%V/SHED/",
skipping to change at line 469 skipping to change at line 469
# Test excludes # Test excludes
json_load.side_effect = [{"exclude": "regexp"}, {}] json_load.side_effect = [{"exclude": "regexp"}, {}]
configuration = Configuration("") configuration = Configuration("")
self.assertEqual(configuration.excludes, ["regexp"]) self.assertEqual(configuration.excludes, ["regexp"])
json_load.side_effect = [{"exclude": ["regexp1", "regexp2"]}, {}] json_load.side_effect = [{"exclude": ["regexp1", "regexp2"]}, {}]
configuration = Configuration("") configuration = Configuration("")
self.assertEqual(configuration.excludes, ["regexp1", "regexp2"]) self.assertEqual(configuration.excludes, ["regexp1", "regexp2"])
json_load.side_effect = [{"exclude": ["regexp1", "regexp2"]}, {}] json_load.side_effect = [{"exclude": ["regexp1", "regexp2"]}, {}]
configuration = Configuration(project_root="", excludes=["regexp3", "reg configuration = Configuration(
exp4"]) project_root="/root", excludes=["regexp3", "regexp4"]
)
self.assertEqual( self.assertEqual(
configuration.excludes, ["regexp3", "regexp4", "regexp1", "regexp2"] configuration.excludes, ["regexp3", "regexp4", "regexp1", "regexp2"]
) )
# Test extensions # Test extensions
json_load.side_effect = [{"extensions": [".a", ".b"]}, {}] json_load.side_effect = [{"extensions": [".a", ".b"]}, {}]
configuration = Configuration("") configuration = Configuration("")
self.assertEqual(configuration.extensions, [".a", ".b"]) self.assertEqual(configuration.extensions, [".a", ".b"])
json_load.side_effect = [{}, {}] json_load.side_effect = [{}, {}]
 End of changes. 4 change blocks. 
5 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)