Skip to content

Commit

Permalink
Merge branch 'release/1.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 13, 2018
2 parents 5e2c696 + fcd7cef commit c20ada1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ogame.go
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ func extractGalaxyInfos(pageHTML, botPlayerName string, botPlayerID, botPlayerRa
classes, _ := s.Attr("class")
if !strings.Contains(classes, "empty_filter") {
activity := 0
activityDiv := s.Find("div.activity")
activityDiv := s.Find("td:not(.moon) div.activity")
if activityDiv != nil {
activityDivClass := activityDiv.AttrOr("class", "")
if strings.Contains(activityDivClass, "minute15") {
Expand Down
1 change: 1 addition & 0 deletions ogame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func TestExtractGalaxyInfosMoonActivity15(t *testing.T) {
pageHTMLBytes, _ := ioutil.ReadFile("samples/galaxy_moon_activity_unprecise.html")
infos, _ := extractGalaxyInfos(string(pageHTMLBytes), "Commodore Nomade", 123, 456)
assert.Equal(t, 8, len(infos))
assert.Equal(t, 0, infos[5].Activity)
assert.Equal(t, 33730993, infos[5].Moon.ID)
assert.Equal(t, 8944, infos[5].Moon.Diameter)
assert.Equal(t, 15, infos[5].Moon.Activity)
Expand Down

0 comments on commit c20ada1

Please sign in to comment.