1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add config options to disable HTTP and scheduler services

This commit is contained in:
Frédéric Guillot 2018-11-11 15:54:19 -08:00
parent 487852f07e
commit becd086865
5 changed files with 80 additions and 3 deletions

View file

@ -658,6 +658,56 @@ func TestHSTS(t *testing.T) {
}
}
func TestDisableHTTPServiceWhenUnset(t *testing.T) {
os.Clearenv()
cfg := NewConfig()
expected := true
result := cfg.HasHTTPService()
if result != expected {
t.Fatalf(`Unexpected DISABLE_HTTP_SERVICE value, got %v instead of %v`, result, expected)
}
}
func TestDisableHTTPService(t *testing.T) {
os.Clearenv()
os.Setenv("DISABLE_HTTP_SERVICE", "1")
cfg := NewConfig()
expected := false
result := cfg.HasHTTPService()
if result != expected {
t.Fatalf(`Unexpected DISABLE_HTTP_SERVICE value, got %v instead of %v`, result, expected)
}
}
func TestDisableSchedulerServiceWhenUnset(t *testing.T) {
os.Clearenv()
cfg := NewConfig()
expected := true
result := cfg.HasSchedulerService()
if result != expected {
t.Fatalf(`Unexpected DISABLE_SCHEDULER_SERVICE value, got %v instead of %v`, result, expected)
}
}
func TestDisableSchedulerService(t *testing.T) {
os.Clearenv()
os.Setenv("DISABLE_SCHEDULER_SERVICE", "1")
cfg := NewConfig()
expected := false
result := cfg.HasSchedulerService()
if result != expected {
t.Fatalf(`Unexpected DISABLE_SCHEDULER_SERVICE value, got %v instead of %v`, result, expected)
}
}
func TestRunMigrationsWhenUnset(t *testing.T) {
os.Clearenv()