1
1
package paperswithcode_go
2
2
3
3
import (
4
- "github.com/codingpot/paperswithcode-go/models"
5
- "github.com/stretchr/testify/assert"
6
4
"testing"
7
- )
8
5
9
- var one int = 1
6
+ "github.com/stretchr/testify/assert"
7
+ )
10
8
11
9
func TestClient_PaperResultList (t * testing.T ) {
12
10
paperID := "hierarchical-multi-scale-attention-for"
13
- bestMetric := "Mean IoU (class)"
14
11
15
12
c := NewClient ()
16
13
got , err := c .PaperResultList (paperID )
17
14
assert .NoError (t , err )
18
-
19
- expected := & models.ResultList {
20
- Count : 2 ,
21
- Next : nil ,
22
- Previous : nil ,
23
- Results : []* models.Result {
24
- {
25
- ID : "657bb1c5-de55-4afc-ba54-0af74eaab5e2" ,
26
- BestRank : & one ,
27
- Metrics : map [string ]string {
28
- bestMetric : "84.2" ,
29
- },
30
- Methodology : "HRNet-OCR (Hierarchical Multi-Scale Attention)" ,
31
- UsesAdditionalData : false ,
32
- Paper : & paperID ,
33
- BestMetric : & bestMetric ,
34
- EvaluatedOn : models .NewYyyyMmDdDashed (2020 , 5 , 21 ),
35
- },
36
- {
37
- ID : "a0db982b-68a8-4685-921d-a8a557304c85" ,
38
- BestRank : nil ,
39
- Metrics : map [string ]string {
40
- "PQ" : "17.6" ,
41
- },
42
- Methodology : "HRNet-OCR (Hierarchical Multi-Scale Attention)" ,
43
- UsesAdditionalData : false ,
44
- Paper : & paperID ,
45
- BestMetric : nil ,
46
- EvaluatedOn : models .NewYyyyMmDdDashed (2020 , 5 , 21 ),
47
- },
48
- },
49
- }
50
-
51
- assert .Equal (t , expected , got )
52
- }
15
+ assert .Greater (t , got .Count , 0 )
16
+ }
0 commit comments