Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
orekit_jpype
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
orekit_jpype
Commits
f7845f59
Commit
f7845f59
authored
5 months ago
by
Petrus Hyvönen
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to file not found error
parent
2d3dfa6a
Branches
Branches containing commit
No related tags found
1 merge request
!22
Fix logging issue 8
Pipeline
#6760
failed
5 months ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
orekit_jpype/pyhelpers.py
+4
-3
4 additions, 3 deletions
orekit_jpype/pyhelpers.py
test/PyhelpersTest.py
+5
-7
5 additions, 7 deletions
test/PyhelpersTest.py
with
9 additions
and
10 deletions
orekit_jpype/pyhelpers.py
+
4
−
3
View file @
f7845f59
...
...
@@ -124,7 +124,7 @@ s
datafile
=
File
(
filename
)
if
not
datafile
.
exists
():
logging
.
warning
(
'
File or folder:
'
,
datafile
.
getAbsolutePath
()
,
'
not found
'
)
logging
.
warning
(
f
"
File or folder:
{
datafile
.
getAbsolutePath
()
}
not found
"
)
logging
.
warning
(
"""
The Orekit library relies on some external data for physical models.
...
...
@@ -140,7 +140,8 @@ s
orekit.pyhelpers.download_orekit_data_curdir()
"""
)
raise
FileNotFoundError
(
'
File or folder:
'
,
datafile
.
getAbsolutePath
(),
'
not found
'
)
raise
FileNotFoundError
(
datafile
.
getAbsolutePath
())
logging
.
debug
(
'
Loading Orekit data from:
'
,
datafile
.
getAbsolutePath
())
...
...
@@ -150,7 +151,7 @@ s
crawler
=
ZipJarCrawler
(
datafile
)
else
:
logging
.
warning
(
'
Could not load orekit data from filename:
'
,
filename
)
raise
FileNotFoundError
(
'
Could not load orekit data from filename:
'
,
filename
)
raise
FileNotFoundError
(
filename
)
DM
.
clearProviders
()
DM
.
clearLoadedDataNames
()
...
...
This diff is collapsed.
Click to expand it.
test/PyhelpersTest.py
+
5
−
7
View file @
f7845f59
...
...
@@ -25,17 +25,15 @@ def test_setup_orekit_data_from_folder():
clear_factories
()
def
test_setup_orekit_data_from_invalid_folder
(
capsys
):
def
test_setup_orekit_data_from_invalid_folder
():
filename
=
"
wrong_folder
"
setup_orekit_data
(
filenames
=
filename
,
from_pip_library
=
False
)
datafile
=
File
(
filename
)
assert
datafile
.
exists
()
==
False
err_msg_expected
=
f
'
File or folder:
{
datafile
.
getAbsolutePath
()
}
not found
'
captured
=
capsys
.
readouterr
()
err_msg_actual
=
captured
.
out
assert
err_msg_actual
.
startswith
(
err_msg_expected
)
with
pytest
.
raises
(
FileNotFoundError
)
as
e
:
setup_orekit_data
(
filenames
=
filename
,
from_pip_library
=
False
)
assert
str
(
e
.
value
)
==
datafile
.
getAbsolutePath
()
clear_factories
()
def
test_setup_orekit_data_default_args
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment