Add POST and DELETE /license endpoints for v4 (#6665)

* Add POST and DELETE /license endpoints for v4

* Fix comment text
Этот коммит содержится в:
Joram Wilander
2017-06-19 13:46:51 -04:00
коммит произвёл Christopher Speller
родитель 59088a1687
Коммит 1d66e64e54
4 изменённых файлов: 164 добавлений и 7 удалений

Просмотреть файл

@@ -356,3 +356,39 @@ func TestPostLog(t *testing.T) {
t.Fatal("should return the log message")
}
}
func TestUploadLicenseFile(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()
Client := th.Client
ok, resp := Client.UploadLicenseFile([]byte{})
CheckForbiddenStatus(t, resp)
if ok {
t.Fatal("should fail")
}
ok, resp = th.SystemAdminClient.UploadLicenseFile([]byte{})
CheckBadRequestStatus(t, resp)
if ok {
t.Fatal("should fail")
}
}
func TestRemoveLicenseFile(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()
Client := th.Client
ok, resp := Client.RemoveLicenseFile()
CheckForbiddenStatus(t, resp)
if ok {
t.Fatal("should fail")
}
ok, resp = th.SystemAdminClient.RemoveLicenseFile()
CheckNoError(t, resp)
if !ok {
t.Fatal("should pass")
}
}