You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
928B

  1. package main
  2. import "testing"
  3. import log "github.com/sirupsen/logrus"
  4. /*
  5. import "github.com/stretchr/testify/mock"
  6. type MockedSteemAPI struct {
  7. mock.Mock
  8. }
  9. func (m *MockedSteemAPI) DoSomething(number int) (bool, error) {
  10. args := m.Called(number)
  11. return args.Bool(0), args.Error(1)
  12. }
  13. */
  14. func TestBlockfetcherInit(t *testing.T) {
  15. log.SetLevel(log.DebugLevel)
  16. bf := NewBlockFetcher(&BlockFetcherConfig{
  17. api: nil,
  18. desiredFetcherThreads: 1,
  19. startBlock: 10000,
  20. endBlock: 10005,
  21. })
  22. if bf == nil {
  23. t.Errorf("could not instantiate blockfetcher")
  24. }
  25. }
  26. //can't actually fetch yet until we mock the api
  27. /*
  28. func TestBlockfetcherFetch(t *testing.T) {
  29. log.SetLevel(log.DebugLevel)
  30. bf := NewBlockFetcher(&BlockFetcherConfig{
  31. api: nil,
  32. desiredFetcherThreads: 1,
  33. startBlock: 10000,
  34. endBlock: 10005,
  35. })
  36. bf.fetch()
  37. }
  38. */