File tree Expand file tree Collapse file tree
tests/OpenClaw.Shared.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
2+ using System . Globalization ;
23using System . IO ;
34using System . Text . Json . Serialization ;
45using System . Threading . Tasks ;
@@ -126,8 +127,8 @@ private static string FormatBytes(long bytes)
126127 return bytes switch
127128 {
128129 < 1024 => $ "{ bytes } B",
129- < 1024 * 1024 => $ "{ bytes / 1024.0 : F1 } KB",
130- _ => $ "{ bytes / ( 1024.0 * 1024.0 ) : F1 } MB"
130+ < 1024 * 1024 => $ "{ ( bytes / 1024.0 ) . ToString ( "F1" , CultureInfo . InvariantCulture ) } KB",
131+ _ => $ "{ ( bytes / ( 1024.0 * 1024.0 ) ) . ToString ( "F1" , CultureInfo . InvariantCulture ) } MB"
131132 } ;
132133 }
133134}
Original file line number Diff line number Diff line change @@ -479,17 +479,19 @@ public void OperatorConnect_FreshDevice_RequestsBootstrapHandoffScopes()
479479 [ Fact ]
480480 public void OperatorConnect_FreshBootstrapDevice_StartsWithV2Signature ( )
481481 {
482- var helper = new GatewayClientTestHelper ( tokenIsBootstrapToken : true ) ;
483- helper . SetDeviceTokenForTest ( null ) ;
482+ var tmpDir = Path . Combine ( Path . GetTempPath ( ) , $ "oca-gw-test-{ Guid . NewGuid ( ) : N} ") ;
483+ Directory . CreateDirectory ( tmpDir ) ;
484+ var helper = new GatewayClientTestHelper ( tokenIsBootstrapToken : true , identityPath : tmpDir ) ;
484485
485486 Assert . True ( helper . Client . UseV2Signature ) ;
486487 }
487488
488489 [ Fact ]
489490 public void OperatorConnect_SharedTokenDevice_StartsWithV3Signature ( )
490491 {
491- var helper = new GatewayClientTestHelper ( tokenIsBootstrapToken : false ) ;
492- helper . SetDeviceTokenForTest ( null ) ;
492+ var tmpDir = Path . Combine ( Path . GetTempPath ( ) , $ "oca-gw-test-{ Guid . NewGuid ( ) : N} ") ;
493+ Directory . CreateDirectory ( tmpDir ) ;
494+ var helper = new GatewayClientTestHelper ( tokenIsBootstrapToken : false , identityPath : tmpDir ) ;
493495
494496 Assert . False ( helper . Client . UseV2Signature ) ;
495497 }
You can’t perform that action at this time.
0 commit comments