Skip to content

Commit

Permalink
Corrected redefinition of methods
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinos-papadopoulos committed Mar 5, 2017
1 parent 525a832 commit 2ec1664
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions util/unittests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,28 @@ def setUpClass(cls):
cls.filepath.append(name)
index -= 1

def test01_file_exists(self):
def test_file_exists_01(self):
"""Checks if foo1.txt exists within self.virtualfolder folder
"""
self.assertTrue(f.file_exists(self.filepath[0]))

def test02_file_exists(self):
def test_file_exists_02(self):
"""Checks if foo2.txt exists within the self.virtualfolder folder
"""
self.assertTrue(f.file_exists(self.filepath[1]))

def test03_file_exists(self):
def test_file_exists_03(self):
"""Checks if foo3.txt exist within the self.virtualfolder.
"""
self.assertTrue(f.file_exists(self.filepath[2]))

def test04_is_file_exe(self):
def test_is_file_exe(self):
"""Checks if foo1.txt within the self.virtualfolder is exe
"""
os.chmod(self.filepath[0], self.chmode[0])
self.assertTrue(f.is_file_exe(self.filepath[0]))

def test05_check_files_exist(self):
def test_check_files_exist(self):
"""Checks file existence within the virtualfolder
"""
# Change to the virtualfolder directory and test the tstlist if files
Expand All @@ -85,7 +85,7 @@ def test05_check_files_exist(self):
# Return to parent directory after test is over and continue
os.chdir(os.pardir)

def test06_check_files_executables(self):
def test_check_files_executables(self):
"""Modifies recursively self.virtualfolder so that all
files become executables and tests if all files within the
self.virtualfolder are executables
Expand Down
18 changes: 9 additions & 9 deletions util/unittests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def setUpClass(cls):
cls.not_list_of_dictionaries = [1, 2, 'a', 3]
cls.noise = 'This_is_just_noise'

def test_isalistofdictionaries(self):
def test_isalistofdictionaries_01(self):
"""Checks the isalistofdictionaries() method of
util/html.py. It checks the equality of the result of an input.
- in this case is checked the result, when the provided input is a
Expand All @@ -110,7 +110,7 @@ def test_isalistofdictionaries(self):
('Testing isalistofdictionaries output. '
'Assert true'))

def test_isalistofdictionaries(self):
def test_isalistofdictionaries_02(self):
"""Checks the isalistofdictionaries() method of
util/html.py. Checks the equality of the result of an input.
- in this case is checked the result, when the provided input is a
Expand All @@ -123,7 +123,7 @@ def test_isalistofdictionaries(self):
('Testing isalistofdictionaries output. '
'Assert false 1'))

def test_isalistofdictionaries(self):
def test_isalistofdictionaries_03(self):
"""Checks the isalistofdictionaries() method of
util/html.py. Checks the equality of the result of an input.
- in this case is checked the result, when the provided input is not
Expand Down Expand Up @@ -189,7 +189,7 @@ def setUpClass(cls):
cls.row_data2['result3'] = 900
cls.multy_dict_input.append([cls.row_data1, cls.row_data2])

def test_multy_dict_to_html(self):
def test_multy_dict_to_html_01(self):
"""Tests the multy_dict_to_html() method of util/html.py.
It checks the equality of the result of an input.
- In this test case we are using only the compulsory arguments of the
Expand All @@ -202,7 +202,7 @@ def test_multy_dict_to_html(self):
('Testing multy_dict_to_'
'html_multiline output test 2'))

def test_multy_dict_to_html(self):
def test_multy_dict_to_html_02(self):
"""Tests the multy_dict_to_html() method of util/html.py.
It checks the equality of the result of an input. In this test case we
are using only the compulsory arguments of the method
Expand Down Expand Up @@ -283,15 +283,15 @@ def setUpClass(cls):
cls.map_dict['result3'] = 'switches'
cls.map_dict['result4'] = 'switches'

def test_get_ordered_index(self):
def test_get_ordered_index_01(self):
"""Method that tests functionality of get_ordered_index() function
in case where it returns a valid index"""
self.assertEqual(1,
util.html.get_ordered_index('result3',
self.map_dict),
'Testing returned index when key exists.')

def test_get_ordered_index(self):
def test_get_ordered_index_02(self):
"""Method that tests functionality of get_ordered_index() function
in case where it returns a invalid index (returns None)"""
self.assertEqual(-1, util.html.get_ordered_index('result33',
Expand Down Expand Up @@ -332,7 +332,7 @@ def setUpClass(cls):
cls.td_style = 'font-size:bold;'
cls.td_class = 'info'

def test_singledicttabledata(self):
def test_singledicttabledata_01(self):
"""
Method that tests single_dict_table_data() when data_values parameter
is a string value.
Expand All @@ -345,7 +345,7 @@ def test_singledicttabledata(self):
'Testing single_dict_table_data() '
'with a string input.')

def test_singledicttabledata(self):
def test_singledicttabledata_02(self):
"""
Method that tests single_dict_table_data() when data_values parameter
is a List of Dictionaries.
Expand Down
12 changes: 6 additions & 6 deletions util/unittests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def setUpClass(cls):
logging.getLogger().info('NOT OWNED PORT: %s', cls.port_not_owned)
cls.ssh_client = util.netutil.ssh_connect_or_return(NODE_CONNECTION, 10)

def test_getpid_listeningonport(self):
def test_getpid_listeningonport_01(self):
"""Checks the getpid_listeningonport() function of
util/process.py module. Checks the equality between the known process
id of the initializes server, with the one returned from the function.
Expand All @@ -116,7 +116,7 @@ def test_getpid_listeningonport(self):
'Testing the returned PID. Local')


def test_getpid_listeningonport(self):
def test_getpid_listeningonport_02(self):
"""Checks the getpid_listeningonport() function of
util/process.py module. In this scenario we check the result in case
we give as input to the function, a port number on which a process
Expand All @@ -132,7 +132,7 @@ def test_getpid_listeningonport(self):
self.ssh_client),
'Testing when port is not owned. Remote')

def test_getpid_listeningonport(self):
def test_getpid_listeningonport_03(self):
"""Checks the getpid_listeningonport() function of
util/process.py module. In this scenario we check the result in case
we give as input to the function something that is not a port number.
Expand All @@ -147,7 +147,7 @@ def test_getpid_listeningonport(self):
self.ssh_client),
'Testing with an invalid port. Remote')

def test_is_process_running(self):
def test_is_process_running_01(self):
"""Checks the is_process_running() function of
util/process.py module. In this scenario we check the result in case
we give as input to the function a valid process id.
Expand All @@ -158,7 +158,7 @@ def test_is_process_running(self):
self.ssh_client),
'Testing true case for a valid process id. Remote')

def test_is_process_running(self):
def test_is_process_running_02(self):
"""Checks the is_process_running() function of
util/process.py module. In this scenario we check the result in case
we give as input to the function a invalid process id.
Expand All @@ -169,7 +169,7 @@ def test_is_process_running(self):
self.ssh_client),
'Testing false case for invalid process id. Remote')

def test_is_process_running(self):
def test_is_process_running_03(self):
"""Checks the is_process_running() function of
util/process.py module. In this scenario we check the result in case
we give as input to the function a invalid process id.
Expand Down

0 comments on commit 2ec1664

Please sign in to comment.