Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Duncan Macleod
gracedb-client
Commits
fc46517c
Unverified
Commit
fc46517c
authored
Sep 26, 2022
by
Duncan Macleod
Browse files
remove use of mock package
use unittest.mock throughout
parent
aea1745b
Pipeline
#458372
passed with stages
in 6 minutes and 8 seconds
Changes
29
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ligo/gracedb/cli/commands/tests/test_add.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb add event'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_create.py
View file @
fc46517c
...
...
@@ -4,10 +4,7 @@ import datetime
import
pytest
import
shlex
import
six
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_delete.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb delete signoff'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_get.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb get superevent'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_level1_commands.py
View file @
fc46517c
...
...
@@ -3,10 +3,7 @@
# NOT 'gracedb confirm_as_gw' because it has no subcommands.
import
re
import
pytest
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_level1_subcommands.py
View file @
fc46517c
...
...
@@ -3,10 +3,7 @@
# NOT 'gracedb add' because it has subcommands like 'gracedb add event'
import
pytest
import
six
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
from
ligo.gracedb.cli.commands.subcommands
import
InfoCommand
...
...
ligo/gracedb/cli/commands/tests/test_level2_subcommands_help.py
View file @
fc46517c
# Tests for level 2 subcommand help
# Ex: 'gracedb add event'
import
pytest
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
from
.test_level1_commands
import
COMMANDS_TEST_DATA
...
...
ligo/gracedb/cli/commands/tests/test_list.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb list labels'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_remove.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb remove event'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_search.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb create emobservation'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/commands/tests/test_update.py
View file @
fc46517c
...
...
@@ -2,10 +2,7 @@
# Ex: 'gracedb create emobservation'
import
pytest
import
shlex
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Apply module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/tests/test_cli.py
View file @
fc46517c
import
re
import
pytest
import
six
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
# Add module-level mark
pytestmark
=
pytest
.
mark
.
cli
...
...
ligo/gracedb/cli/tests/test_main.py
View file @
fc46517c
import
json
import
pytest
# import six
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
from
ligo.gracedb.exceptions
import
HTTPError
from
requests
import
Response
...
...
ligo/gracedb/test/conftest.py
View file @
fc46517c
import
datetime
try
:
from
unittest
import
mock
except
ImportError
:
import
mock
from
unittest
import
mock
from
cryptography
import
x509
from
cryptography.x509.oid
import
NameOID
...
...
ligo/gracedb/test/test_certificate.py
View file @
fc46517c
import
itertools
import
pytest
try
:
from
unittest
import
mock
except
ImportError
:
# py < 3
import
mock
from
unittest
import
mock
from
ligo.gracedb.rest
import
GraceDb
from
ligo.gracedb.cert
import
check_certificate_expiration
...
...
ligo/gracedb/test/test_emobservations.py
View file @
fc46517c
try
:
from
unittest
import
mock
except
ImportError
:
# python < 3
import
mock
from
unittest
import
mock
import
pytest
...
...
ligo/gracedb/test/test_events.py
View file @
fc46517c
try
:
from
unittest
import
mock
except
ImportError
:
# python < 3
import
mock
from
unittest
import
mock
import
six
import
pytest
...
...
ligo/gracedb/test/test_files.py
View file @
fc46517c
try
:
from
unittest
import
mock
except
ImportError
:
# python < 3
import
mock
import
os
from
unittest
import
mock
import
pytest
...
...
ligo/gracedb/test/test_labels.py
View file @
fc46517c
try
:
from
unittest
import
mock
except
ImportError
:
# python < 3
import
mock
from
unittest
import
mock
import
pytest
...
...
ligo/gracedb/test/test_logging.py
View file @
fc46517c
import
logging
try
:
from
unittest
import
mock
except
ImportError
:
# py < 3
import
mock
import
time
import
types
from
unittest
import
mock
from
ligo.gracedb.logging
import
GraceDbLogHandler
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment