mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-12 23:18:49 +00:00
refactor: simplify flag parsing in TestProdCommandFlagParsing
- Removed unused `--force` and `--domain` flags from the test case to streamline the flag parsing logic. - Updated the test to focus on essential flags, enhancing clarity and maintainability.
This commit is contained in:
parent
badaa920d9
commit
b1732b2cbe
@ -42,14 +42,11 @@ func TestProdCommandFlagParsing(t *testing.T) {
|
|||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
// Extract flags manually to verify parsing logic
|
// Extract flags manually to verify parsing logic
|
||||||
force := false
|
|
||||||
isBootstrap := false
|
isBootstrap := false
|
||||||
var vpsIP, domain, peersStr, bootstrapJoin string
|
var vpsIP, peersStr, bootstrapJoin string
|
||||||
|
|
||||||
for i, arg := range tt.args {
|
for i, arg := range tt.args {
|
||||||
switch arg {
|
switch arg {
|
||||||
case "--force":
|
|
||||||
force = true
|
|
||||||
case "--bootstrap":
|
case "--bootstrap":
|
||||||
isBootstrap = true
|
isBootstrap = true
|
||||||
case "--peers":
|
case "--peers":
|
||||||
@ -60,10 +57,6 @@ func TestProdCommandFlagParsing(t *testing.T) {
|
|||||||
if i+1 < len(tt.args) {
|
if i+1 < len(tt.args) {
|
||||||
vpsIP = tt.args[i+1]
|
vpsIP = tt.args[i+1]
|
||||||
}
|
}
|
||||||
case "--domain":
|
|
||||||
if i+1 < len(tt.args) {
|
|
||||||
domain = tt.args[i+1]
|
|
||||||
}
|
|
||||||
case "--bootstrap-join":
|
case "--bootstrap-join":
|
||||||
if i+1 < len(tt.args) {
|
if i+1 < len(tt.args) {
|
||||||
bootstrapJoin = tt.args[i+1]
|
bootstrapJoin = tt.args[i+1]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user