Skip to content

Commit cc3ce24

Browse files
Update test_notice_publisher.py
1 parent 7ff82fb commit cc3ce24

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

tests/e2e/notice_publisher/adapters/test_notice_publisher.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,16 @@
33
import pytest
44

55
from ted_sws import config
6-
from ted_sws.notice_publisher.adapters.notice_publisher import NoticePublisherFactory, Publisher
7-
from ted_sws.notice_publisher.adapters.sftp_notice_publisher import SFTPNoticePublisher
8-
9-
10-
def test_notice_publisher():
11-
with pytest.raises(Exception):
12-
NoticePublisherFactory.get_publisher(publisher=Publisher.SFTP, hostname=None)
13-
NoticePublisherFactory.get_publisher(publisher=Publisher.SFTP, hostname="HOST", username="USER", password="PASS",
14-
port=0, remote_path="")
6+
from ted_sws.notice_publisher.adapters.sftp_notice_publisher import SFTPPublisher
157

168

179
def test_sftp_notice_publisher():
18-
user = config.SFTP_USER
19-
password = config.SFTP_PASSWORD
20-
host = None
21-
port = 0
22-
23-
sftp_publisher = SFTPNoticePublisher(hostname=host, username=user, password=password, port=port, remote_path=None)
10+
sftp_publisher = SFTPPublisher(port=0)
2411

2512
with pytest.raises(Exception):
2613
sftp_publisher.connect()
2714

28-
sftp_publisher.hostname = config.SFTP_HOST
29-
sftp_publisher.port = int(config.SFTP_PORT)
15+
sftp_publisher.port = config.SFTP_PORT
3016
sftp_publisher.connect()
3117

3218
source_file = tempfile.NamedTemporaryFile()
@@ -51,3 +37,4 @@ def test_sftp_notice_publisher():
5137
assert not sftp_publisher.connection.exists(remote_path)
5238

5339
sftp_publisher.disconnect()
40+

0 commit comments

Comments
 (0)