Ejemplo n.º 1
0
 def test_credentials_load_writes_new_netrc_entry_if_file_does_not_exist(self, mock_does_not_exist, mock_chmod):
     with patch("builtins.open", mock_open(read_data=EXPECTED_NETRC)):
         credentials = FileCredentialsProvider()
         credentials.save(MockCredentialsData)
         utils.validate_netrc_contents(self)
Ejemplo n.º 2
0
 def test_credentials_load_calls_build_netrc(self, mock_exists, mock_chmod):
     netrc.netrc = MagicMock(return_value=MockNetrc)
     credentials = FileCredentialsProvider()
     credentials.build_netrc = MagicMock()
     credentials.save(MockCredentialsData)
     credentials.build_netrc.assert_called_once_with(MockNetrc)