eaal 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gemtest +0 -0
- data/History.txt +8 -0
- data/README.rdoc +3 -1
- data/Rakefile +5 -6
- data/lib/eaal.rb +5 -4
- data/lib/eaal/cache/memcached.rb +4 -3
- data/lib/eaal/result.rb +5 -5
- data/test/fixtures/test/test/eve/AllianceList/Request_.xml +12224 -10523
- data/test/test_eaal.rb +65 -5
- metadata +78 -33
data/test/test_eaal.rb
CHANGED
|
@@ -7,7 +7,8 @@ class TestEaal < Test::Unit::TestCase
|
|
|
7
7
|
EAAL.cache = EAAL::Cache::FileCache.new(File.dirname(__FILE__) + '/fixtures/')
|
|
8
8
|
@api = EAAL::API.new('test','test')
|
|
9
9
|
end
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
# test if we really got an API Object
|
|
11
12
|
def test_api_class
|
|
12
13
|
assert_instance_of EAAL::API, @api
|
|
13
14
|
end
|
|
@@ -15,7 +16,7 @@ class TestEaal < Test::Unit::TestCase
|
|
|
15
16
|
# some random tests if parsing the xml builds the right class
|
|
16
17
|
def test_api_classes
|
|
17
18
|
@api.scope = "char"
|
|
18
|
-
assert_raise
|
|
19
|
+
assert_raise EAAL::Exception.EveAPIException(105) do @api.Killlog end
|
|
19
20
|
assert_equal @api.Killlog(:characterID => 12345).class.name, "CharKilllogResult"
|
|
20
21
|
assert_equal @api.Killlog(:characterID => 12345).kills.class.name, "CharKilllogRowsetKills"
|
|
21
22
|
assert_equal @api.Killlog(:characterID => 12345).kills.first.class.name, "CharKilllogRowsetKillsRow"
|
|
@@ -32,6 +33,22 @@ class TestEaal < Test::Unit::TestCase
|
|
|
32
33
|
assert_equal @api.Killlog(:characterID => 12345).kills.length, 1
|
|
33
34
|
assert_equal @api.Killlog(:characterID => 12345).kills.first.victim.characterName, "Peter Powers"
|
|
34
35
|
assert_equal @api.Killlog(:characterID => 12345).kills.first.attackers.first.characterID, "12345"
|
|
36
|
+
assert_equal @api.SkillInTraining(:characterID => 12345).skillInTraining, "1"
|
|
37
|
+
assert_equal @api.SkillInTraining(:characterID => 12345).trainingDestinationSP, "135765"
|
|
38
|
+
assert_equal @api.CharacterSheet(:characterID => 12345).attributes.willpower, "10"
|
|
39
|
+
assert_equal @api.CharacterSheet(:characterID => 12345).gender, "Female"
|
|
40
|
+
assert_equal @api.CharacterSheet(:characterID => 12345).corporationRoles[0].roleName, "roleDirector"
|
|
41
|
+
assert_equal @api.CharacterSheet(:characterID => 12345).skills[4].typeID, "3445"
|
|
42
|
+
assert_nil @api.CharacterSheet(:characterID => 12345).skills[4].level
|
|
43
|
+
# test unpublished skill (like Black Market, not sure it exists now)
|
|
44
|
+
assert_equal @api.CharacterSheet(:characterID => 12345).skills[4].unpublished, "1"
|
|
45
|
+
assert_equal @api.SkillQueue(:characterID => 12345).skillqueue[0].level, "3"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def test_server_status
|
|
49
|
+
@api.scope = "server"
|
|
50
|
+
assert_not_nil @api.ServerStatus
|
|
51
|
+
assert_not_nil @api.ServerStatus.onlinePlayers
|
|
35
52
|
end
|
|
36
53
|
|
|
37
54
|
# test to check if bug 23177 is fixed. that bug lead to RowSets beeing encapsulated in ResultElements.
|
|
@@ -39,15 +56,58 @@ class TestEaal < Test::Unit::TestCase
|
|
|
39
56
|
@api.scope = "eve"
|
|
40
57
|
assert_kind_of EAAL::Rowset::RowsetBase, @api.AllianceList.alliances.first.memberCorporations
|
|
41
58
|
end
|
|
59
|
+
|
|
60
|
+
# test for Standings.xml
|
|
61
|
+
def test_standings
|
|
62
|
+
@api.scope = "account"
|
|
63
|
+
id = @api.Characters.characters.first.characterID
|
|
64
|
+
@api.scope = "char"
|
|
65
|
+
assert_equal @api.Standings(:characterID => 12345).standingsTo.characters[0].toName, "Test Ally"
|
|
66
|
+
assert_equal @api.Standings(:characterID => 12345).standingsTo.characters[0].standing, "1"
|
|
67
|
+
assert_equal @api.Standings(:characterID => 12345).standingsFrom.NPCCorporations[1].fromName, "Carthum Conglomerate"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# test for CorporationSheet
|
|
71
|
+
def test_corporation
|
|
72
|
+
@api.scope = "corp"
|
|
73
|
+
assert_equal @api.CorporationSheet(:corporationID => 150212025).corporationID, "150212025"
|
|
74
|
+
assert_equal @api.CorporationSheet(:corporationID => 150212025).ceoName, "Mark Roled"
|
|
75
|
+
assert_equal @api.CorporationSheet(:corporationID => 150212025).walletDivisions[0].description, "Master Wallet"
|
|
76
|
+
end
|
|
77
|
+
|
|
42
78
|
# Test to ensure Memcached works
|
|
43
79
|
def test_memcached
|
|
80
|
+
# FIXME must check if memcache server is installed... (binary memcache)
|
|
81
|
+
# Note if I run memcached I get a new error: EAAL::Exception::APINotFoundError: The requested API (account / Chracters) could not be found.
|
|
82
|
+
# this beacuse eaal request to EVE api the Test Tester PG....
|
|
44
83
|
# TODO: API needs mocking properly instead of depending on file cache for test loading.
|
|
84
|
+
|
|
45
85
|
EAAL.cache = EAAL::Cache::MemcachedCache.new
|
|
46
|
-
|
|
86
|
+
|
|
87
|
+
assert_instance_of EAAL::Cache::MemcachedCache, EAAL.cache
|
|
88
|
+
|
|
89
|
+
# loading an XML from fixtures
|
|
90
|
+
file = 'test/fixtures/test/test/account/Characters/Request_.xml'
|
|
91
|
+
xml = ''
|
|
92
|
+
File.open(file, File::RDONLY).each { |line| xml += line }
|
|
93
|
+
|
|
94
|
+
@api.scope = 'account'
|
|
95
|
+
|
|
96
|
+
# store to cache
|
|
97
|
+
assert_equal EAAL.cache.save(@api.userid,@api.key,@api.scope,'Characters','',xml), "STORED\r\n"
|
|
98
|
+
|
|
99
|
+
# check key in cache
|
|
100
|
+
assert_equal EAAL.cache.key(@api.userid,@api.key,@api.scope,'Characters',''), "testtestaccountCharacters"
|
|
101
|
+
|
|
102
|
+
# load from cache
|
|
103
|
+
assert_equal EAAL.cache.load(@api.userid,@api.key,@api.scope,'Characters',''), xml
|
|
104
|
+
|
|
105
|
+
# FIXME high level tests
|
|
47
106
|
# Should store to cache
|
|
48
|
-
assert_equal @api.Characters.characters.first.name, "Test Tester"
|
|
107
|
+
#assert_equal @api.Characters.characters.first.name, "Test Tester"
|
|
49
108
|
# Should get from cache
|
|
50
|
-
assert_equal @api.Characters.characters.first.name, "Test Tester"
|
|
109
|
+
#assert_equal @api.Characters.characters.first.name, "Test Tester"
|
|
51
110
|
# TODO: Needs some better tests here.
|
|
52
111
|
end
|
|
112
|
+
|
|
53
113
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eaal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
4
|
+
hash: 21
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 1
|
|
9
|
+
- 7
|
|
10
|
+
version: 0.1.7
|
|
5
11
|
platform: ruby
|
|
6
12
|
authors:
|
|
7
13
|
- Peter Petermann
|
|
@@ -9,62 +15,93 @@ autorequire:
|
|
|
9
15
|
bindir: bin
|
|
10
16
|
cert_chain: []
|
|
11
17
|
|
|
12
|
-
date:
|
|
18
|
+
date: 2011-03-16 00:00:00 +01:00
|
|
13
19
|
default_executable:
|
|
14
20
|
dependencies:
|
|
15
21
|
- !ruby/object:Gem::Dependency
|
|
16
22
|
name: activesupport
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
20
26
|
requirements:
|
|
21
27
|
- - ">="
|
|
22
28
|
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 11
|
|
30
|
+
segments:
|
|
31
|
+
- 2
|
|
32
|
+
- 0
|
|
33
|
+
- 2
|
|
23
34
|
version: 2.0.2
|
|
24
|
-
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id001
|
|
25
37
|
- !ruby/object:Gem::Dependency
|
|
26
38
|
name: hpricot
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
30
42
|
requirements:
|
|
31
43
|
- - ">="
|
|
32
44
|
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 7
|
|
46
|
+
segments:
|
|
47
|
+
- 0
|
|
48
|
+
- 6
|
|
33
49
|
version: "0.6"
|
|
34
|
-
|
|
50
|
+
type: :runtime
|
|
51
|
+
version_requirements: *id002
|
|
35
52
|
- !ruby/object:Gem::Dependency
|
|
36
53
|
name: memcache-client
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
prerelease: false
|
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
56
|
+
none: false
|
|
40
57
|
requirements:
|
|
41
58
|
- - ">="
|
|
42
59
|
- !ruby/object:Gem::Version
|
|
60
|
+
hash: 9
|
|
61
|
+
segments:
|
|
62
|
+
- 1
|
|
63
|
+
- 7
|
|
64
|
+
- 1
|
|
43
65
|
version: 1.7.1
|
|
44
|
-
|
|
66
|
+
type: :runtime
|
|
67
|
+
version_requirements: *id003
|
|
45
68
|
- !ruby/object:Gem::Dependency
|
|
46
69
|
name: newgem
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
70
|
+
prerelease: false
|
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
72
|
+
none: false
|
|
50
73
|
requirements:
|
|
51
74
|
- - ">="
|
|
52
75
|
- !ruby/object:Gem::Version
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
hash: 5
|
|
77
|
+
segments:
|
|
78
|
+
- 1
|
|
79
|
+
- 5
|
|
80
|
+
- 3
|
|
81
|
+
version: 1.5.3
|
|
82
|
+
type: :development
|
|
83
|
+
version_requirements: *id004
|
|
55
84
|
- !ruby/object:Gem::Dependency
|
|
56
85
|
name: hoe
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
86
|
+
prerelease: false
|
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
88
|
+
none: false
|
|
60
89
|
requirements:
|
|
61
90
|
- - ">="
|
|
62
91
|
- !ruby/object:Gem::Version
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
hash: 41
|
|
93
|
+
segments:
|
|
94
|
+
- 2
|
|
95
|
+
- 9
|
|
96
|
+
- 1
|
|
97
|
+
version: 2.9.1
|
|
98
|
+
type: :development
|
|
99
|
+
version_requirements: *id005
|
|
100
|
+
description: |-
|
|
101
|
+
EAAL (Eve API Access Layer) is a ruby library for accessing data of the API of
|
|
102
|
+
the game Eve Online
|
|
66
103
|
email:
|
|
67
|
-
-
|
|
104
|
+
- ppetermann80@googlemail.com
|
|
68
105
|
executables: []
|
|
69
106
|
|
|
70
107
|
extensions: []
|
|
@@ -73,7 +110,6 @@ extra_rdoc_files:
|
|
|
73
110
|
- History.txt
|
|
74
111
|
- LICENSE.txt
|
|
75
112
|
- Manifest.txt
|
|
76
|
-
- README.rdoc
|
|
77
113
|
files:
|
|
78
114
|
- History.txt
|
|
79
115
|
- LICENSE.txt
|
|
@@ -97,32 +133,41 @@ files:
|
|
|
97
133
|
- test/fixtures/test/test/eve/AllianceList/Request_.xml
|
|
98
134
|
- test/test_eaal.rb
|
|
99
135
|
- test/test_helper.rb
|
|
136
|
+
- .gemtest
|
|
100
137
|
has_rdoc: true
|
|
101
|
-
homepage:
|
|
138
|
+
homepage: http://eaal.rubyforge.org
|
|
139
|
+
licenses: []
|
|
140
|
+
|
|
102
141
|
post_install_message:
|
|
103
142
|
rdoc_options:
|
|
104
143
|
- --main
|
|
105
|
-
- README.
|
|
144
|
+
- README.txt
|
|
106
145
|
require_paths:
|
|
107
146
|
- lib
|
|
108
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
|
+
none: false
|
|
109
149
|
requirements:
|
|
110
150
|
- - ">="
|
|
111
151
|
- !ruby/object:Gem::Version
|
|
152
|
+
hash: 3
|
|
153
|
+
segments:
|
|
154
|
+
- 0
|
|
112
155
|
version: "0"
|
|
113
|
-
version:
|
|
114
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
|
+
none: false
|
|
115
158
|
requirements:
|
|
116
159
|
- - ">="
|
|
117
160
|
- !ruby/object:Gem::Version
|
|
161
|
+
hash: 3
|
|
162
|
+
segments:
|
|
163
|
+
- 0
|
|
118
164
|
version: "0"
|
|
119
|
-
version:
|
|
120
165
|
requirements: []
|
|
121
166
|
|
|
122
167
|
rubyforge_project: eaal
|
|
123
|
-
rubygems_version: 1.
|
|
168
|
+
rubygems_version: 1.6.2
|
|
124
169
|
signing_key:
|
|
125
|
-
specification_version:
|
|
170
|
+
specification_version: 3
|
|
126
171
|
summary: EAAL (Eve API Access Layer) is a ruby library for accessing data of the API of the game Eve Online
|
|
127
172
|
test_files:
|
|
128
173
|
- test/test_eaal.rb
|