Exemple #1
0
func TestHidden(t *testing.T) {
	SetLogger(liblog.NewLog(liblog.Logs))
	altConfigPath := ""
	confdir := cdglobal.ConfigDirDock(altConfigPath)
	hidden := loadHidden(confdir)
	fmt.Println(hidden.DefaultBackend)
	fmt.Println(hidden.LastVersion)
	fmt.Println(hidden.LastYear)
	fmt.Println(hidden.SessionWasUsed)
}
Exemple #2
0
func main() {
	logger := log.NewLog(log.Logs)

	externalUserDir, e := packages.DirAppletsExternal("") // option config dir
	log.Fatal(e, "DirAppletsExternal")

	packs, e := editpack.PacksExternal(logger, externalUserDir)
	log.Fatal(e, "get external packages")

	editpack.Start(logger, packs)
}
Exemple #3
0
// New creates a new applet manager.
//
func New() *CDApplet {
	app := &CDApplet{
		action: &action.Actions{},
		log:    log.NewLog(log.Logs),
	}

	app.command = &appCmd{
		commands: make(cdtype.Commands),
		app:      app,
	}

	return app
}
Exemple #4
0
func TestConfig(t *testing.T) {
	gtk.Init(nil)

	build := vdata.TestInit(vdata.New(log.NewLog(log.Logs), nil, nil), vdata.PathTestConf())
	if build == nil {
		return
	}
	build.BuildAll(pageswitch.New())

	assert.Equal(t, countChanged(t, build), 0, "Build unchanged")

	build.KeyWalk(vdata.TestValues)
	assert.Equal(t, countChanged(t, build), 32, "Build full change")
}
Exemple #5
0
func newUpclt() (*uptoshare.Uploader, error) {
	tmp, e := ioutil.TempFile("", tmpHistory+".")
	if e != nil {
		return nil, e
	}
	// Uptoshare actions
	up := uptoshare.New()
	up.Log = log.NewLog(log.Logs).SetName("uptoshare_test")
	// up.SetPreCheck(func() {  })
	// up.SetPostCheck(func() {  })

	// Uptoshare settings.
	up.SetHistoryFile(tmp.Name())
	up.SetHistorySize(42)
	// up.LimitRate = app.conf.UploadRateLimit
	// up.PostAnonymous = app.conf.PostAnonymous

	return up, nil
}
Exemple #6
0
func main() {
	gtk.Init(nil)
	win, e := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
	if e != nil {
		println(e.Error())
		return
	}

	path, isTest := vdata.TestPathDefault()
	var saveCall func(cftype.Builder)
	if isTest {
		saveCall = cfprint.Updated
	} else {
		saveCall = func(build cftype.Builder) { cfprint.Default(build, true) }
	}
	source := vdata.New(log.NewLog(log.Logs), win, saveCall)
	build := vdata.TestInit(source, path)
	source.SetGrouper(build)

	glib.IdleAdd(packWindow(win, source, build))
	gtk.Main()
}
Exemple #7
0
func main() {
	path, isTest := vdata.TestPathDefault()

	// path := cdglobal.ConfigDirDock("") + "/current_theme/cairo-dock.conf"

	// path := cdglobal.AppBuildPathFull(pathGoGmail...)

	gtk.Init(nil)

	source := vdata.New(log.NewLog(log.Logs), nil, nil)
	build := vdata.TestInit(source, path)
	if build == nil {
		return
	}
	build.BuildAll(pageswitch.New())
	if isTest {
		cfprint.Updated(build)
		build.KeyWalk(vdata.TestValues)
		cfprint.Updated(build)
	} else {
		cfprint.Default(build, true)
	}
}
Exemple #8
0
package packages_test

import (
	"github.com/stretchr/testify/assert"

	"github.com/sqp/godock/libs/log" // Display info in terminal.
	"github.com/sqp/godock/libs/packages"

	"os"
	"strings"
	"testing"
)

const appDir = "../../applets"

var logger = log.NewLog(log.Logs)

func TestListFromDir(t *testing.T) {
	packs, e := packages.ListFromDir(logger, appDir, packages.TypeGoInternal, packages.SourceApplet)
	if !assert.NoError(t, e, "ListFromDir") || !assert.NotEmpty(t, packs, "ListFromDir") {
		return
	}
	assert.NotEmpty(t, packs[0].DisplayedName, "DisplayedName")
}

func TestNewPack(t *testing.T) {
	appname := "Audio"

	// Load package.
	pack, e := packages.NewAppletPackageUser(logger, appDir, appname, packages.TypeGoInternal, packages.SourceApplet)
	assert.NoError(t, e, "NewAppletPackageUser")