This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.py
executable file
·49 lines (41 loc) · 1.48 KB
/
Test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3.2
# -*- coding: utf-8 -*-
# vim:fileencoding=utf8
import unittest
from Main import FTPConnector, ConnectionInfo, ServerList, Main
import CommentGenerate
import Database
class TestSequence(unittest.TestCase):
""" Class to do all the testing"""
def setUp(self):
""" Things that will need to be run before the tests"""
self._server_list = ServerList("serverlist.csv")
self._server_list_matrix = self._server_list.make_matrix()
def test_connect(self):
self._ftp_connector = FTPConnector(self._server_list_matrix)
def test_list(self):
self._ftp_connector = FTPConnector(self._server_list_matrix)
self._ftp_connector.list()
def test_discconect(self):
self._ftp_connector = FTPConnector(self._server_list_matrix)
self._ftp_connector.disconnect()
def test_CommentGenerate(self):
c = CommentGenerate.CommentGenerate()
c.openFile()
def test_Database(self):
d = Database.Database()
file_list= [["fil1", "/etc/fil1", "server.se"],["fil2", "/etc/fil2", "server.org"],["fil3", "/etc/fil3", "server.com"]]
d.updateDB(file_list)
print("------DATABASE DUMP ---------")
d.list()
d.disconnect()
#d.initDB() #This is already done and the file is in the repo
# def test_download(self):
# self._ftp_connector = FTPConnector(self._server_list_matrix)
# self._ftp_connector.download("README")
# #d.initDB() #This is already done and the file is in the repo
# def test_Main(self):
# main = Main()
#main.list()
if __name__ == '__main__':
unittest.main()