File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
tests/servicex_did_finder_lib Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ pytest = "^5.2"
1515flake8 = " ^3.9.1"
1616pytest-mock = " ^3.5.1"
1717coverage = " ^5.5"
18+ responses = " ^0.14.0"
1819
1920[build-system ]
2021requires = [" poetry-core>=1.0.0" ]
Original file line number Diff line number Diff line change 33
44def test_version ():
55 assert __version__ == '1.0.0a1'
6+
7+
8+ @responses .activate
9+ def test_put_file_add ():
10+ responses .add (responses .PUT , 'http://servicex.org/files' , status = 206 )
11+ sx = ServiceXAdapter ("http://servicex.org" )
12+ sx .put_file_add ({
13+ 'file_path' : 'root://foo.bar.ROOT' ,
14+ 'adler32' : '32' ,
15+ 'file_size' : 1024 ,
16+ 'file_events' : 3141
17+ })
18+
19+ assert len (responses .calls ) == 1
20+ submitted = json .loads (responses .calls [0 ].request .body )
21+ assert submitted ['file_path' ] == 'root://foo.bar.ROOT'
22+ assert submitted ['adler32' ] == '32'
23+ assert submitted ['file_events' ] == 3141
24+ assert submitted ['file_size' ] == 1024
25+
You can’t perform that action at this time.
0 commit comments