Skip to content

Commit

Permalink
Correct the import name for sapcarmod & update
Browse files Browse the repository at this point in the history
function description
  • Loading branch information
simran committed Mar 28, 2020
1 parent f3f117f commit ec988ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions tests/unit/modules/test_sapcarmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
)

# Import Salt Libs
import salt.modules.sapcarmod as sapcar
import salt.modules.sapcarmod as sapcarmod


@skipIf(NO_MOCK, NO_MOCK_REASON)
class SapcarModuleTest(TestCase, LoaderModuleMockMixin):
'''
This class contains a set of functions that test salt.modules.sapcar.
This class contains a set of functions that test salt.modules.sapcarmod.
'''

def setup_loader_modules(self):
return {sapcar: {}}
return {sapcarmod: {}}

@patch('salt.modules.sapcarmod.saputils.extract_sapcar_file')
def test_extract_return(self, mock_extract):
'''
Test extract method - return
'''
mock_extract.return_value = 0
assert sapcar.extract('/sapmedia/SAPCAR','/sapmedia/IMDB_SERVER_LINUX.SAR', '/sapmedia/HANA', '-v') == 0
assert sapcarmod.extract('/sapmedia/SAPCAR','/sapmedia/IMDB_SERVER_LINUX.SAR', '/sapmedia/HANA', '-v') == 0
mock_extract.assert_called_once_with(
sapcar_exe='/sapmedia/SAPCAR', sar_file='/sapmedia/IMDB_SERVER_LINUX.SAR',
output_dir='/sapmedia/HANA', options='-v')
Expand All @@ -51,9 +51,9 @@ def test_extract_raise(self, mock_extract):
'''
Test extract method - raise
'''
mock_extract.side_effect = sapcar.saputils.SapUtilsError('error')
mock_extract.side_effect = sapcarmod.saputils.SapUtilsError('error')
with pytest.raises(exceptions.CommandExecutionError) as err:
sapcar.extract('/sapmedia/SAPCAR','/sapmedia/IMDB_SERVER_LINUX.SAR', '/sapmedia/HANA', '-v')
sapcarmod.extract('/sapmedia/SAPCAR','/sapmedia/IMDB_SERVER_LINUX.SAR', '/sapmedia/HANA', '-v')
mock_extract.assert_called_once_with(
sapcar_exe='/sapmedia/SAPCAR', sar_file='/sapmedia/IMDB_SERVER_LINUX.SAR',
output_dir='/sapmedia/HANA', options='-v')
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/states/test_sapcarmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_extracted_basic(self):

def test_extracted_error_exception(self):
'''
Test to check extracted when sapcar fails extracts a sar file
Test to check extracted when sapcar fails to extracts a sar file
'''

expected_ret = {
Expand Down

0 comments on commit ec988ad

Please sign in to comment.