forked from TrueCloudLab/frostfs-api-go
Add unit tests for container access modes
This commit is contained in:
parent
6b6728356a
commit
7e6e30b850
1 changed files with 20 additions and 0 deletions
|
@ -55,3 +55,23 @@ func TestCID(t *testing.T) {
|
||||||
require.Equal(t, cid1, cid2)
|
require.Equal(t, cid1, cid2)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAccessMode(t *testing.T) {
|
||||||
|
t.Run("read access to read/write mode", func(t *testing.T) {
|
||||||
|
require.Equal(t, AccessModeRead, AccessModeReadWrite&AccessModeRead)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("write access to read/write mode", func(t *testing.T) {
|
||||||
|
require.Equal(t, AccessModeWrite, AccessModeReadWrite&AccessModeWrite)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("read(write) access to write(read) mode", func(t *testing.T) {
|
||||||
|
require.Zero(t, AccessModeRead&AccessModeWrite)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("access to same mode", func(t *testing.T) {
|
||||||
|
require.Equal(t, AccessModeWrite, AccessModeWrite&AccessModeWrite)
|
||||||
|
require.Equal(t, AccessModeRead, AccessModeRead&AccessModeRead)
|
||||||
|
require.Equal(t, AccessModeReadWrite, AccessModeReadWrite&AccessModeReadWrite)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue