open-space-toolkit-io 0.7.0__py38-none-any.whl → 0.7.2__py38-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: open-space-toolkit-io
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: Addressing, networking, database connectors.
5
5
  Author: Open Space Collective
6
6
  Author-email: contact@open-space-collective.org
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Operating System :: POSIX :: Linux
13
13
  Description-Content-Type: text/markdown
14
- Requires-Dist: open-space-toolkit-core (>=0.7.2)
14
+ Requires-Dist: open-space-toolkit-core (~=0.7.3)
15
15
 
16
16
  # Open Space Toolkit ▸ I/O
17
17
 
@@ -1,18 +1,18 @@
1
1
  ostk/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
2
- ostk/io/OpenSpaceToolkitIOPy.cpython-38-x86_64-linux-gnu.so,sha256=1FsaKNkByFsFkLM3aP9QI-CtJy4S8-29RIAq1tAIAwI,307152
2
+ ostk/io/OpenSpaceToolkitIOPy.cpython-38-x86_64-linux-gnu.so,sha256=C-wY8hoK0FYxX_o7TEPmx32rKp7idHP2jAG0O5d_lKY,307136
3
3
  ostk/io/__init__.py,sha256=IpLxatW_R2ItRy031KQcbFRNczGDpWeozg9COJH9QLA,83
4
- ostk/io/libopen-space-toolkit-io.so.0,sha256=f0swjBFA7PWp4Q-tNqAxs977zp4HOOzedAR36UsDm4U,9332048
4
+ ostk/io/libopen-space-toolkit-io.so.0,sha256=_mmxgKx9XjpDPasV_ZeZnbe8LdKqEZ2Euz1F3gMWyhg,9332440
5
5
  ostk/io/test/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
6
6
  ostk/io/test/ip/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
7
7
  ostk/io/test/ip/tcp/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
8
8
  ostk/io/test/ip/tcp/http/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
9
- ostk/io/test/ip/tcp/http/test_client.py,sha256=_bzJRC14HV1XHgdTYBfmrfBWBKVqZkQD5KdCXgdqqjM,531
9
+ ostk/io/test/ip/tcp/http/test_client.py,sha256=I0nRWp3HTkr2oMEbOSZJZEYVHxn7pbAdE6kBdI29mbU,1682
10
10
  ostk/io/test/ip/tcp/http/test_request.py,sha256=-puxxwFqhzizeX8odF0gqgbRCXLk_zDCZkQuEUNJYx0,2205
11
11
  ostk/io/test/ip/tcp/http/test_response.py,sha256=GAnbvAeNHJO9odmvxmZrW-ruuCHLYI-xYMJFQAE41lw,5866
12
12
  ostk/io/test/url/__init__.py,sha256=epnVn2PwdQkUDZ1msqBRO5nEZIOUBIq-IfK3IlNPijE,21
13
13
  ostk/io/test/url/test_url.py,sha256=g4kFtb-05atsd6ypnDanUCQgizpOfNwrNtzWzBIsLE8,4555
14
- open_space_toolkit_io-0.7.0.dist-info/METADATA,sha256=GxjRgIEOvANlDYz5fK68-Bb6CPa52yKXRM4Z1PcldhE,1674
15
- open_space_toolkit_io-0.7.0.dist-info/WHEEL,sha256=2yDD3rMJmJrwnxn8b9ifgvawPCe_Rmy9Sl-bMDPPHog,93
16
- open_space_toolkit_io-0.7.0.dist-info/top_level.txt,sha256=zOR18699uDYnafgarhL8WU_LmTZY_5NVqutv-flp_x4,5
17
- open_space_toolkit_io-0.7.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
18
- open_space_toolkit_io-0.7.0.dist-info/RECORD,,
14
+ open_space_toolkit_io-0.7.2.dist-info/METADATA,sha256=FAPUYotfwXzTZ-ZCYY7rfS-KP9IYvDRQvHlxuHnZusQ,1674
15
+ open_space_toolkit_io-0.7.2.dist-info/WHEEL,sha256=pruk-ncpSL7wyHyfRUEyLDsvov8r7FCaWTBJ2klfed4,93
16
+ open_space_toolkit_io-0.7.2.dist-info/top_level.txt,sha256=zOR18699uDYnafgarhL8WU_LmTZY_5NVqutv-flp_x4,5
17
+ open_space_toolkit_io-0.7.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
18
+ open_space_toolkit_io-0.7.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: bdist_wheel (0.41.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py38-none-any
5
5
 
Binary file
@@ -3,6 +3,7 @@
3
3
  import pytest
4
4
 
5
5
  import ostk.io as io
6
+ from ostk.core.filesystem import Directory, File, Path
6
7
 
7
8
  URL = io.URL
8
9
  Request = io.ip.tcp.http.Request
@@ -10,16 +11,50 @@ Response = io.ip.tcp.http.Response
10
11
  Client = io.ip.tcp.http.Client
11
12
 
12
13
 
13
- def test_http_client():
14
- response = Client.get(URL.parse("https://www.google.com"))
14
+ def test_http_client_get_success():
15
+ url = URL.parse("https://www.google.com")
16
+
17
+ response = Client.get(url)
15
18
 
16
19
  assert response is not None
17
20
  assert response.is_defined() is True
18
21
  assert response.is_ok() is True
19
22
  assert response.get_status_code() == Response.StatusCode.Ok
20
23
 
21
- # response = Client.send()
22
24
 
23
- # response = Client.fetch()
25
+ def test_http_client_send_success():
26
+ url = URL.parse("https://www.google.com")
27
+
28
+ request = Request(Request.Method.Get, url, "")
29
+ response = Client.send(request)
30
+
31
+ assert response is not None
32
+ assert response.is_defined() is True
33
+ assert response.is_ok() is True
34
+ assert response.get_status_code() == Response.StatusCode.Ok
35
+
36
+
37
+ def test_http_client_fetch_success():
38
+ url = URL.parse(
39
+ "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"
40
+ )
41
+ directory = Directory.path(Path.parse("/tmp"))
42
+
43
+ file_response = Client.fetch(url, directory)
44
+
45
+ assert file_response is not None
46
+ assert file_response.exists() is True
47
+
48
+
49
+ # def test_http_client_list_success():
50
+
51
+ # Disabling similar to the C++ test. The list takes about 1 minute to complete for some reason.
52
+
53
+ # url = URL.parse("ftp://naif.jpl.nasa.gov/pub/naif/generic_kernels/")
54
+ # file_input = File.path(Path.parse("/tmp/listing.txt"))
55
+ # response = Client.list(url, file_input, 3)
24
56
 
25
- # response = Client.list()
57
+ # assert response is not None
58
+ # assert response.is_defined() is True
59
+ # assert response.is_ok() is True
60
+ # assert response.get_status_code() == Response.StatusCode.Ok