Skip to content

Commit

Permalink
Add unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeichikawasalesforce committed Jun 21, 2023
1 parent 735a7bd commit 59e3dbd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/unit/server_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ def test_no_state_ini_file_or_state_dir(
TabPyApp(None)
self.assertEqual(len(mock_os.makedirs.mock_calls), 1)

@patch('builtins.input', return_value='y')
@patch("tabpy.tabpy_server.app.app.os")
@patch("tabpy.tabpy_server.app.app.os.path.exists", return_value=False)
@patch("tabpy.tabpy_server.app.app.PythonServiceHandler")
@patch("tabpy.tabpy_server.app.app._get_state_from_file")
@patch("tabpy.tabpy_server.app.app.TabPyState")
def test_handle_configuration_without_authentication(
self,
mock_tabpy_state,
mock_get_state_from_file,
mock_psws,
mock_os_path_exists,
mock_os,
mock_input,
):
TabPyApp(None)
mock_input.assert_not_called()

TabPyApp(None, False)
mock_input.assert_called()

class TestPartialConfigFile(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 59e3dbd

Please sign in to comment.