Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
gracedb-client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo Pound Singer
gracedb-client
Commits
453d760d
Verified
Commit
453d760d
authored
Sep 12, 2018
by
Tanner Prestegard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding in compatibility for Python 3.5, 3.6, and 3.7
parent
4976f5b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
ligo/gracedb/test/test.py
ligo/gracedb/test/test.py
+1
-1
ligo/gracedb/test/test_superevents.py
ligo/gracedb/test/test_superevents.py
+13
-8
setup.py
setup.py
+1
-1
No files found.
ligo/gracedb/test/test.py
View file @
453d760d
...
...
@@ -373,7 +373,7 @@ class TestMain(TestGraceDb):
log
.
addHandler
(
handler
)
try
:
message
=
"Message is {0}"
.
format
(
random
.
random
())
log
.
warn
(
message
)
log
.
warn
ing
(
message
)
finally
:
log
.
removeHandler
(
handler
)
finally
:
...
...
ligo/gracedb/test/test_superevents.py
View file @
453d760d
...
...
@@ -16,10 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with gracedb. If not, see <http://www.gnu.org/licenses/>.
from
__future__
import
print_function
from
builtins
import
map
from
collections
import
defaultdict
import
datetime
import
os
from
six
import
iteritems
import
six
from
six.moves
import
range
import
unittest
...
...
@@ -376,7 +377,7 @@ class TestSuperevents(TestGraceDb):
# Test file contents
file_from_server
=
response
.
read
()
file_handler
=
open
(
upload
,
'r'
)
file_handler
=
open
(
upload
,
'r
b
'
)
file_from_disk
=
file_handler
.
read
()
file_handler
.
close
()
self
.
assertEqual
(
file_from_server
,
file_from_disk
)
...
...
@@ -395,7 +396,9 @@ class TestSuperevents(TestGraceDb):
self
.
assertEqual
(
response
.
status
,
201
)
# Test response data
self
.
assertItemsEqual
(
tags
,
data
[
'tag_names'
])
# We use six here since assertItemsEqual in Python 2.7 is
# called assertCountEqual in Python 3.3+
six
.
assertCountEqual
(
self
,
tags
,
data
[
'tag_names'
])
self
.
assertEqual
(
data
[
'comment'
],
msg
)
def
test_log_tag_and_untag
(
self
):
...
...
@@ -431,7 +434,9 @@ class TestSuperevents(TestGraceDb):
self
.
assertEqual
(
response
.
status
,
200
)
# Test log tags
self
.
assertItemsEqual
([
tag
],
log_data
[
'tag_names'
])
# We use six here since assertItemsEqual in Python 2.7 is
# called assertCountEqual in Python 3.3+
six
.
assertCountEqual
(
self
,
[
tag
],
log_data
[
'tag_names'
])
# Remove tag from log
response
=
self
.
_gracedb
.
removeTag
(
self
.
_superevent
,
data
[
'N'
],
tag
)
...
...
@@ -499,8 +504,8 @@ class TestSuperevents(TestGraceDb):
dec_list
=
[
5
,
6
,
7
,
8
]
dec_width_list
=
[
0.7
]
*
len
(
dec_list
)
now
=
datetime
.
datetime
.
now
()
start_time_list
=
map
(
lambda
i
:
(
now
+
datetime
.
timedelta
(
seconds
=
i
)).
isoformat
(),
[
0
,
1
,
2
,
3
])
start_time_list
=
list
(
map
(
lambda
i
:
(
now
+
datetime
.
timedelta
(
seconds
=
i
)).
isoformat
(),
[
0
,
1
,
2
,
3
])
)
duration_list
=
[
1
]
*
len
(
start_time_list
)
comment
=
"test comment"
response
=
self
.
_gracedb
.
writeEMObservation
(
self
.
_superevent
,
emgroup
,
...
...
@@ -755,7 +760,7 @@ class TestSuperevents(TestGraceDb):
for
p
in
data
:
group_perms
[
p
[
'group'
]].
append
(
p
[
'permission'
])
# Check contents
for
group
,
perms
in
iteritems
(
group_perms
):
for
group
,
perms
in
six
.
iteritems
(
group_perms
):
if
(
group
==
'public_users'
):
self
.
assertEqual
(
len
(
perms
),
1
)
self
.
assertIn
(
'view_superevent'
,
perms
)
...
...
@@ -774,7 +779,7 @@ class TestSuperevents(TestGraceDb):
for
p
in
data
:
group_perms
[
p
[
'group'
]].
append
(
p
[
'permission'
])
# Check contents
for
group
,
perms
in
iteritems
(
group_perms
):
for
group
,
perms
in
six
.
iteritems
(
group_perms
):
if
(
group
==
'public_users'
):
self
.
assertEqual
(
len
(
perms
),
1
)
self
.
assertIn
(
'view_superevent'
,
perms
)
...
...
setup.py
View file @
453d760d
...
...
@@ -53,7 +53,7 @@ setup(
#provides = ['ligo.gracedb'],
packages
=
find_packages
(),
install_requires
=
[
'six'
],
install_requires
=
[
'
future'
,
'
six'
],
tests_require
=
tests_require
,
package_data
=
{
'ligo.gracedb.test'
:
[
'data/*'
,
'test.sh'
,
'README'
]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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