package store

import (
	"github.com/wenstudio/gofly/config"
	"testing"
)

func TestQn_Upload(t *testing.T) {
	c := config.CreateQiniu("/home/yyk/github/gofly/" + config.QiniuFile)
	t.Log(c)
	q := NewQn(c.Access, c.Secret, c.Bucket, c.Zone)
	f, err := q.Upload("/home/yyk/github/shotshock/assets/img/gongzhonghao.jpg")
	if err != nil {
		t.Error(err)
	}
	t.Log(f)
}

func TestQn_Delete(t *testing.T) {
	c := config.CreateQiniu("/home/yyk/github/gofly/" + config.QiniuFile)
	t.Log(c)
	q := NewQn(c.Access, c.Secret, c.Bucket, c.Zone)
	err := q.Delete("http://twongpicd.shotshock.shop/gongzhonghao.jpg")
	if err != nil {
		t.Error(err)
	}
}
