-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from thomgonzalez/tsg/multiple-connection
Multiple connection
- Loading branch information
Showing
8 changed files
with
130 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
long_description = fh.read() | ||
|
||
setuptools.setup( | ||
name="pyiaccess", | ||
version="0.1.4b1", | ||
name="PyiAccess", | ||
version="0.1.1b1", | ||
author="Tomás Gonzalez", | ||
author_email="[email protected]", | ||
description="It is a library that connects to IBM Power Systems (IBM i), with pyodbc and SSH connection.", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import os | ||
import unittest | ||
from pathlib import Path | ||
from pyiaccess.engine import set_env, create_sftp | ||
|
||
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
path_env = os.path.join(BASE_DIR, ".back.env") | ||
set_env(path_env) | ||
|
||
|
||
class TestSFTPClient(unittest.TestCase): | ||
def setUp(self): | ||
hostname = os.getenv("SFTP_HOST", None) | ||
username = os.getenv("SFTP_USER", None) | ||
password = os.getenv("SFTP_PASSWORD", None) | ||
port = os.getenv("SFTP_PORT", None) | ||
remote_path = os.getenv("SFTP_REMOTE_PATH", None) | ||
|
||
if not hostname and username and password: | ||
raise Exception("Sorry, Undefined environment variables.") | ||
|
||
self.path_file = os.path.join(BASE_DIR, "Clases.csv") | ||
|
||
self.engine = create_sftp( | ||
hostname=hostname, | ||
username=username, | ||
password=password, | ||
port=port, | ||
remote_path=remote_path, | ||
) | ||
|
||
def test_is_file(self): | ||
self.assertEqual(Path(self.path_file).is_file(), True) | ||
|
||
def test_upload_file(self): | ||
self.engine.connect() | ||
self.engine.upload(self.path_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters