Example #1
0
 def test_sanitize_peers_before_validation(self, mock_validate_peers,
                                           mock_build, mock_generate_key):
     commands.config_setup(
         env=_env_fixture("booth_name"),
         booth_configuration={},
     )
     mock_validate_peers.assert_called_once_with([], [])
Example #2
0
 def test_sanitize_peers_before_validation(
     self, mock_validate_peers, mock_build, mock_generate_binary_key
 ):
     commands.config_setup(
         env=_env_fixture("booth_name"),
         booth_configuration={},
     )
     mock_validate_peers.assert_called_once_with([], [])
     mock_generate_binary_key.assert_called_once_with(random_bytes_count=64)
Example #3
0
 def test_successfuly_build_and_write_to_std_path(
     self, mock_validate_peers, mock_build, mock_generate_key
 ):
     env = mock.MagicMock()
     commands.config_setup(
         env,
         booth_configuration=[
             {"key": "site", "value": "1.1.1.1", "details": []},
             {"key": "arbitrator", "value": "2.2.2.2", "details": []},
         ],
     )
     env.booth.create_config.assert_called_once_with(
         "config content",
         False
     )
     env.booth.create_key.assert_called_once_with(
         "key value",
         False
     )
     mock_validate_peers.assert_called_once_with(
         ["1.1.1.1"], ["2.2.2.2"]
     )
Example #4
0
 def test_successfuly_build_and_write_to_std_path(
     self, mock_validate_peers, mock_build, mock_generate_key
 ):
     env = mock.MagicMock()
     commands.config_setup(
         env,
         booth_configuration=[
             {"key": "site", "value": "1.1.1.1", "details": []},
             {"key": "arbitrator", "value": "2.2.2.2", "details": []},
         ],
     )
     env.booth.create_config.assert_called_once_with(
         "config content",
         False
     )
     env.booth.create_key.assert_called_once_with(
         "key value",
         False
     )
     mock_validate_peers.assert_called_once_with(
         ["1.1.1.1"], ["2.2.2.2"]
     )
Example #5
0
 def test_successfuly_build_and_write_to_std_path(
     self, mock_validate_peers, mock_build, mock_generate_binary_key
 ):
     env = _env_fixture("booth_name")
     commands.config_setup(
         env,
         booth_configuration=[
             {"key": "site", "value": "1.1.1.1", "details": []},
             {"key": "arbitrator", "value": "2.2.2.2", "details": []},
         ],
     )
     env.booth.create_config.assert_called_once_with(
         "config content",
         False
     )
     env.booth.create_key.assert_called_once_with(
         b"key value",
         False
     )
     mock_validate_peers.assert_called_once_with(
         ["1.1.1.1"], ["2.2.2.2"]
     )
     mock_generate_binary_key.assert_called_once_with(random_bytes_count=64)
Example #6
0
 def test_sanitize_peers_before_validation(
     self, mock_validate_peers, mock_build, mock_generate_key
 ):
     commands.config_setup(env=mock.MagicMock(), booth_configuration={})
     mock_validate_peers.assert_called_once_with([], [])
Example #7
0
 def test_sanitize_peers_before_validation(self, mock_validate_peers,
                                           mock_build, mock_generate_key):
     commands.config_setup(env=mock.MagicMock(), booth_configuration={})
     mock_validate_peers.assert_called_once_with([], [])