1- #![ End -to-end tests for SVM -related commands
1+ #![ End -to-end tests for SVM -related commands]
22
33use crate :: tests:: e2e:: common:: { run_osvm_command, run_osvm_command_string, output_contains} ;
44
55#[ test]
66fn test_svm_list ( ) {
77 let output = run_osvm_command_string ( & [ "svm" , "list" ] ) ;
8-
8+
99 // Verify the output contains expected headers
1010 assert ! ( output_contains( & output, "Available SVMs in the chain:" ) ) ;
1111 assert ! ( output_contains( & output, "NAME" ) ) ;
1212 assert ! ( output_contains( & output, "DISPLAY NAME" ) ) ;
1313 assert ! ( output_contains( & output, "TOKEN" ) ) ;
14-
14+
1515 // Verify the output contains some expected SVMs
1616 assert ! ( output_contains( & output, "solana" ) ) ;
1717 assert ! ( output_contains( & output, "sonic" ) ) ;
@@ -21,17 +21,17 @@ fn test_svm_list() {
2121#[ test]
2222fn test_svm_get_solana ( ) {
2323 let output = run_osvm_command_string ( & [ "svm" , "get" , "solana" ] ) ;
24-
24+
2525 // Verify the output contains expected Solana information
2626 assert ! ( output_contains( & output, "SVM Information: Solana" ) ) ;
2727 assert ! ( output_contains( & output, "Token: SOL" ) ) ;
2828 assert ! ( output_contains( & output, "Website: https://solana.com" ) ) ;
29-
29+
3030 // Verify network information is present
3131 assert ! ( output_contains( & output, "MAINNET Network:" ) ) ;
3232 assert ! ( output_contains( & output, "TESTNET Network:" ) ) ;
3333 assert ! ( output_contains( & output, "DEVNET Network:" ) ) ;
34-
34+
3535 // Verify system requirements are present
3636 assert ! ( output_contains( & output, "Validator Requirements:" ) ) ;
3737 assert ! ( output_contains( & output, "RPC Node Requirements:" ) ) ;
@@ -40,10 +40,10 @@ fn test_svm_get_solana() {
4040#[ test]
4141fn test_svm_get_invalid ( ) {
4242 let output = run_osvm_command ( & [ "svm" , "get" , "invalid_svm" ] ) ;
43-
43+
4444 // Verify the command fails with a non-zero exit code
4545 assert ! ( !output. status. success( ) ) ;
46-
46+
4747 // Verify the error message
4848 let error = String :: from_utf8_lossy ( & output. stderr ) ;
4949 assert ! ( error. contains( "SVM not found" ) || error. contains( "Error:" ) ) ;
@@ -57,7 +57,7 @@ fn test_svm_dashboard() {
5757 let assert = run_osvm_command ( )
5858 . args ( & [ "svm" , "dashboard" ] )
5959 . assert ( ) ;
60-
60+
6161 // The dashboard might not work in a test environment, so we're just checking
6262 // that the command is recognized
6363 assert. stderr ( predicate:: str:: contains ( "Unknown command" ) . not ( ) ) ;
@@ -69,10 +69,10 @@ fn test_svm_with_config_file() {
6969 // Create a temporary directory and config file
7070 let temp_dir = create_temp_dir ( ) ;
7171 let config_path = create_mock_config ( & temp_dir) ;
72-
72+
7373 // Run the command with the config file
7474 let output = run_osvm_command_string ( & [ "-C" , config_path. to_str ( ) . unwrap ( ) , "svm" , "list" ] ) ;
75-
75+
7676 // Verify the output contains expected headers
7777 assert ! ( output_contains( & output, "Available SVMs in the chain:" ) ) ;
7878}
@@ -83,10 +83,10 @@ fn test_svm_with_url() {
8383 // Create a mock server
8484 let mock_server = MockServer :: new ( ) ;
8585 let _mock = mock_server. mock_svm_list ( ) ;
86-
86+
8787 // Run the command with a custom URL
8888 let output = run_osvm_command_string ( & [ "--url" , & format ! ( "http://{}" , mock_server. server. host_with_port( ) ) , "svm" , "list" ] ) ;
89-
89+
9090 // Verify the output contains expected headers
9191 assert ! ( output_contains( & output, "Available SVMs in the chain:" ) ) ;
9292}
0 commit comments