def test_get_config_dir_when_path_not_exists(mocker): # setup mockbase = MockBase("resources") mockbase.setup(resources) expected_result = "/test/other/dir/config" # pylint: disable=protected-access resources.__CONFIG_DIR = "/test/dir" mocked_exists = mockbase.mock_os_any(mocker, "path.exists", False) mocked_filename = mockbase.mock_resource_filename(mocker, expected_result) # run actual_result = resources.get_config_dir() # assert mocked_exists.assert_called_once_with("/test/dir") mocked_filename.assert_called_once() assert actual_result == expected_result
def test_get_scripts_dir_when_path_not_exists(mocker): # setup _setup() # pylint: disable=protected-access resources.__SCRIPTS_DIR = "/test/dir" mockbase = MockBase("resources") mocked_exists = mockbase.mock_os_any(mocker, "path.exists", False) expected_result = "/test/dir" mocked_filename = mockbase.mock_resource_filename(mocker, expected_result) # run actual_result = resources.get_scripts_dir() # assert mocked_exists.assert_called_once_with(expected_result) mocked_filename.assert_called_once() assert actual_result == expected_result