forked from TrueCloudLab/frostfs-sdk-go
[#127] apistatus: Support WRONG_MAGIC_NUMBER status
Define `WrongMagicNumber` type for which encapsulates the work with incorrect network magic. Provide method to read/write the correct magic (which is a status detail in NeoFS API V2 protocol). Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
883a26d210
commit
0fb22361a3
6 changed files with 121 additions and 3 deletions
|
@ -49,6 +49,16 @@ func TestToStatusV2(t *testing.T) {
|
|||
}),
|
||||
codeV2: 1024,
|
||||
},
|
||||
{
|
||||
status: (statusConstructor)(func() apistatus.Status {
|
||||
var st apistatus.WrongMagicNumber
|
||||
|
||||
st.WriteCorrectMagic(322)
|
||||
|
||||
return st
|
||||
}),
|
||||
codeV2: 1025,
|
||||
},
|
||||
} {
|
||||
var st apistatus.Status
|
||||
|
||||
|
@ -117,6 +127,16 @@ func TestFromStatusV2(t *testing.T) {
|
|||
}),
|
||||
codeV2: 1024,
|
||||
},
|
||||
{
|
||||
status: (statusConstructor)(func() apistatus.Status {
|
||||
var st apistatus.WrongMagicNumber
|
||||
|
||||
st.WriteCorrectMagic(322)
|
||||
|
||||
return st
|
||||
}),
|
||||
codeV2: 1025,
|
||||
},
|
||||
} {
|
||||
var st apistatus.Status
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue