aemo 0.1.33 → 0.1.34

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca301be5d4754d50280f56bca3a296742b6a5e74
4
- data.tar.gz: cfa3c66379d9732d9b80b6c9c0ad24a3d732b2e6
3
+ metadata.gz: 74f32714f901733d865a3c9f609962579fa45db7
4
+ data.tar.gz: 3f5edd9c91603c6543454cd93fc73451c7af6044
5
5
  SHA512:
6
- metadata.gz: c472c8e7fcc281fbd9f2e97fe456a6ebeba80edbd4a97b85d689071e070eb845f0d7cdb9a62041201c7b44e2db2bd607022a1211184d6e025d2fcbbb507c8c65
7
- data.tar.gz: ecc5af0102d75552622f5b0ccb3a6d15c8afe99590a0a0f08d1b275b7b879fd90f45789daebf96558e81b355a6d265967745087ed57d845ec4311470764fd041
6
+ metadata.gz: 99c6bd09338c5831c957cdce5e99aa77079c9c6adfba2c665b76757fed635edfc57a3546804ac0c6481b849c6362da3f3b48ad0a0f4a964b83188f579a2d29a7
7
+ data.tar.gz: cf82786f4c1c29910127a3710e87e045ad1d0f95310ad7b6e8110e2e733f9e138f8de6194c6cd116469ef30ddffca6176295071811e02f10644897969586ad58
data/lib/aemo.rb CHANGED
@@ -5,6 +5,7 @@ require 'csv'
5
5
  require 'aemo/region.rb'
6
6
  require 'aemo/market.rb'
7
7
  require 'aemo/market/interval.rb'
8
+ require 'aemo/market/node.rb'
8
9
  require 'aemo/nem12.rb'
9
10
  require 'aemo/nmi.rb'
10
11
  require 'aemo/msats.rb'
@@ -13,6 +13,8 @@ module AEMO
13
13
 
14
14
  attr_accessor :datetime, :region, :total_demand, :rrp, :period_type
15
15
 
16
+ # Create a new instance of an Interval
17
+ #
16
18
  # @param [Time] datetime
17
19
  # @param [Hash] options Hash of optional data values
18
20
  # @return [AEMO::Market::Interval]
@@ -0,0 +1,41 @@
1
+ module AEMO
2
+ module Market
3
+ # AEMO::Market::Interval
4
+ #
5
+ # @author Joel Courtney
6
+ # @abstract
7
+ # @since 0.1.0
8
+ class Node
9
+ IDENTIFIERS = %w(NSW QLD SA TAS VIC)
10
+
11
+ attr_accessor :identifier
12
+
13
+ def initialize(identifier)
14
+ raise ArgumentError, "Node Identifier '#{identifier}' is not valid." unless IDENTIFIERS.include?(identifier.upcase)
15
+ @identifier = identifier
16
+ @current_trading = []
17
+ @current_dispatch = []
18
+ end
19
+
20
+ # Return the current dispatch data
21
+ #
22
+ # @return [Array<AEMO::Market::Interval>]
23
+ def current_dispatch
24
+ if @current_dispatch.empty? || @current_dispatch.last.datetime != (Time.now - Time.now.to_i % 300)
25
+ @current_dispatch = AEMO::Market.current_dispatch(@identifier)
26
+ end
27
+ @current_dispatch
28
+ end
29
+
30
+ # Return the current trading data
31
+ #
32
+ # @return [Array<AEMO::Market::Interval>]
33
+ def current_trading
34
+ if @current_trading.empty? || @current_trading.reject { |i| i.period_type != 'TRADE' }.last.datetime != (Time.now - Time.now.to_i % 300)
35
+ @current_trading = AEMO::Market.current_trading(@identifier)
36
+ end
37
+ @current_trading
38
+ end
39
+ end
40
+ end
41
+ end
data/lib/aemo/nmi.rb CHANGED
@@ -712,7 +712,6 @@ module AEMO
712
712
  raise 'start cannot be after finish' if start > finish
713
713
  possible_values = TNI_CODES[@tni]
714
714
  .reject { |x| start > DateTime.parse(x['ToDate']) || finish < DateTime.parse(x['FromDate']) }
715
- .reject { |x| start > DateTime.parse(x['finish']) || finish < DateTime.parse(x['start']) }
716
715
  return nil if possible_values.empty?
717
716
  possible_values.map { |x| x['mlf_data']['loss_factors'] }
718
717
  end
data/lib/aemo/region.rb CHANGED
@@ -18,48 +18,70 @@ module AEMO
18
18
  }.freeze
19
19
 
20
20
  attr_accessor :region
21
+ attr_reader :aemo_market_node
21
22
 
23
+ class << self
24
+ def all
25
+ REGIONS.keys.map { |k| AEMO::Region.new(k) }
26
+ end
27
+ end
28
+
29
+ # Create a new instance of AEMO::Region
30
+ #
31
+ # @param [String] region State
32
+ # @return [self]
22
33
  def initialize(region)
23
34
  raise ArgumentError, "Region '#{region}' is not valid." unless valid_region?(region)
24
- @region = region
35
+ @region = region.upcase
36
+ @full_name = REGIONS[@region]
25
37
  @current_trading = []
26
38
  @current_dispatch = []
39
+ @aemo_market_node = if %w(NSW QLD SA TAS VIC).include?(@region)
40
+ AEMO::Market::Node.new(region)
41
+ elsif @region == 'ACT'
42
+ AEMO::Market::Node.new('NSW')
43
+ end
27
44
  end
28
45
 
46
+ # Abbreviation method
47
+ #
48
+ # @return [String]
29
49
  def abbr
30
50
  @region
31
51
  end
32
52
 
53
+ # @return [String]
33
54
  def to_s
34
55
  @region
35
56
  end
36
57
 
58
+ # @return [String]
37
59
  def fullname
38
60
  REGIONS[@region]
39
61
  end
40
62
 
63
+ # Return the current dispatch data
64
+ #
65
+ # @return [Array<AEMO::Market::Interval>]
41
66
  def current_dispatch
42
- if @current_dispatch.empty? || @current_dispatch.last.datetime != (Time.now - Time.now.to_i % 300)
43
- @current_dispatch = AEMO::Market.current_dispatch(@region)
44
- end
45
- @current_dispatch
67
+ @aemo_market_node.current_dispatch
46
68
  end
47
69
 
70
+ # Return the current trading data
71
+ #
72
+ # @return [Array<AEMO::Market::Interval>]
48
73
  def current_trading
49
- if @current_trading.empty? || @current_trading.reject { |i| i.period_type != 'TRADE' }.last.datetime != (Time.now - Time.now.to_i % 300)
50
- @current_trading = AEMO::Market.current_trading(@region)
51
- end
52
- @current_trading
53
- end
54
-
55
- def self.all
56
- REGIONS.keys.map { |k| AEMO::Region.new(k) }
74
+ @aemo_market_node.current_trading
57
75
  end
58
76
 
59
77
  protected
60
78
 
79
+ # Validates a region
80
+ #
81
+ # @param [String] region
82
+ # @return [Boolean]
61
83
  def valid_region?(region)
62
- REGIONS.keys.include?(region)
84
+ REGIONS.keys.include?(region.upcase)
63
85
  end
64
86
  end
65
87
  end
data/lib/aemo/version.rb CHANGED
@@ -22,7 +22,7 @@
22
22
  # @author Joel Courtney <euphemize@gmail.com>
23
23
  module AEMO
24
24
  # aemo version
25
- VERSION = '0.1.33'.freeze
25
+ VERSION = '0.1.34'.freeze
26
26
 
27
27
  # aemo version split amongst different revisions
28
28
  MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)
File without changes
@@ -15,10 +15,10 @@ require 'active_support/all'
15
15
  file_contents = File.read(File.join(@path, 'tni-mlf-codes.csv')).encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
16
16
  CSV.parse(file_contents, headers: true, converters: :numeric).each do |row|
17
17
  @mlf_data[row['TNI']] ||= { location: row['Location'], voltage: row['Voltage'], loss_factors: [] }
18
- @mlf_data[row['TNI']][:loss_factors] << { start: DateTime.parse('2016-07-01T00:00:00+1000'), finish: DateTime.parse('2017-07-01T00:00:00+1000'), value: row['FY17'] }
19
- @mlf_data[row['TNI']][:loss_factors] << { start: DateTime.parse('2015-07-01T00:00:00+1000'), finish: DateTime.parse('2016-07-01T00:00:00+1000'), value: row['FY16'] }
20
- @mlf_data[row['TNI']][:loss_factors] << { start: DateTime.parse('2014-07-01T00:00:00+1000'), finish: DateTime.parse('2015-07-01T00:00:00+1000'), value: row['FY15'] }
21
- @mlf_data[row['TNI']][:loss_factors] << { start: DateTime.parse('2013-07-01T00:00:00+1000'), finish: DateTime.parse('2014-07-01T00:00:00+1000'), value: row['FY14'] }
18
+ row.headers.select{|x| x =~ %r{^FY\d{2}$}}.sort.reverse.each do |fin_year|
19
+ year = "20#{fin_year.match(/FY(\d{2})/)[1]}".to_i
20
+ @mlf_data[row['TNI']][:loss_factors] << { start: DateTime.parse("#{year - 1}-07-01T00:00:00+1000"), finish: DateTime.parse("#{year}-07-01T00:00:00+1000"), value: row[fin_year] }
21
+ end
22
22
  end
23
23
 
24
24
  # TNI to MLF
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe AEMO::Market::Interval do
4
- describe 'AEMO::Market::Interval contstants' do
4
+ describe 'AEMO::Market::Interval constants' do
5
5
  it 'has INTERVALS' do
6
6
  expect(AEMO::Market::Interval::INTERVALS).to eq(trading: 'Trading', dispatch: 'Dispatch')
7
7
  end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe AEMO::Market::Node do
4
+ describe '.IDENTIFIERS' do
5
+ it 'should be an array' do
6
+ expect(AEMO::Market::Node::IDENTIFIERS).to be_instance_of(Array)
7
+ end
8
+ end
9
+
10
+ describe 'creating a node' do
11
+ it 'should raise an error if invalid region' do
12
+ expect { AEMO::Market::Node.new('BOTTOMS') }.to raise_error(ArgumentError)
13
+ end
14
+ it 'should create if node valid' do
15
+ expect { AEMO::Market::Node.new('NSW') }.not_to raise_error
16
+ end
17
+ end
18
+
19
+ describe 'AEMO::Region instance methods' do
20
+ before(:each) do
21
+ @nsw = AEMO::Market::Node.new('NSW')
22
+ end
23
+
24
+ describe 'AEMO::Region dispatch information' do
25
+ it 'should return current dispatch data' do
26
+ expect(@nsw.current_dispatch.count).to eq(AEMO::Market.current_dispatch(@nsw.identifier).count)
27
+ end
28
+ it 'should return current trading data' do
29
+ expect(@nsw.current_trading.count).to eq(AEMO::Market.current_trading(@nsw.identifier).count)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -9,74 +9,147 @@ describe AEMO::MSATS do
9
9
 
10
10
  describe 'class methods' do
11
11
  describe 'nmi details' do
12
- before(:each) do
13
- AEMO::MSATS.authorize('ER', 'ER', 'ER')
14
- end
12
+ describe 'valid MSATS user' do
13
+ before(:each) do
14
+ AEMO::MSATS.authorize('ER', 'ER', 'ER')
15
+ end
15
16
 
16
- it 'should get data for a valid nmi' do
17
- nmi_detail_query = AEMO::MSATS.nmi_detail('4001234567')
18
- expect(nmi_detail_query.class).to eq(Hash)
19
- end
20
- it 'should get a 404 for a nonexistent nmi' do
21
- # nmi_detail_query = AEMO::MSATS.nmi_detail('4001234566')
22
- # TODO workout what the different errors are here...
17
+ it 'should get data for a valid nmi' do
18
+ nmi_detail_query = AEMO::MSATS.nmi_detail('4001234567')
19
+ expect(nmi_detail_query.class).to eq(Hash)
20
+ end
21
+ it 'should get a 404 for a nonexistent nmi' do
22
+ # nmi_detail_query = AEMO::MSATS.nmi_detail('4001234566')
23
+ # TODO workout what the different errors are here...
24
+ end
25
+ it 'should raise an error for a bad nmi' do
26
+ expect { AEMO::MSATS.nmi_detail('BOBISAFISH') }.to raise_error(ArgumentError)
27
+ end
23
28
  end
24
- it 'should raise an error for a bad nmi' do
25
- expect { AEMO::MSATS.nmi_detail('BOBISAFISH') }.to raise_error(ArgumentError)
29
+
30
+ describe 'invalid MSATS user' do
31
+ before(:each) do
32
+ AEMO::MSATS.authorize('NOTER', 'NOTER', 'NOTER')
33
+ end
34
+
35
+ it 'should get data for a valid nmi' do
36
+ nmi_detail_query = AEMO::MSATS.nmi_detail('4001234567')
37
+ expect(nmi_detail_query.class).to eq(HTTParty::Response)
38
+ end
26
39
  end
27
40
  end
28
41
 
29
42
  describe '#c4' do
30
- before(:each) do
31
- AEMO::MSATS.authorize('ER', 'ER', 'ER')
32
- end
43
+ describe 'valid MSATS account' do
44
+ before(:each) do
45
+ AEMO::MSATS.authorize('ER', 'ER', 'ER')
46
+ end
33
47
 
34
- it 'should return a hash of information' do
35
- AEMO::MSATS.c4('4001234567', DateTime.now, DateTime.now, DateTime.now)
48
+ it 'should return a hash of information' do
49
+ expect(AEMO::MSATS.c4('4001234567', DateTime.now, DateTime.now, DateTime.now)).to be_a(Hash)
50
+ end
51
+ it 'should raise an error for a bad nmi' do
52
+ expect { AEMO::MSATS.c4('BOBISAFISH') }.to raise_error(ArgumentError)
53
+ end
54
+ it 'should return a hash of information' do
55
+ # AEMO::MSATS.c4('4001234566', DateTime.now, DateTime.now, DateTime.now)
56
+ # TODO workout what the different errors are here...
57
+ end
36
58
  end
37
- it 'should raise an error for a bad nmi' do
38
- expect { AEMO::MSATS.c4('BOBISAFISH') }.to raise_error(ArgumentError)
39
- end
40
- it 'should return a hash of information' do
41
- # AEMO::MSATS.c4('4001234566', DateTime.now, DateTime.now, DateTime.now)
42
- # TODO workout what the different errors are here...
59
+
60
+ describe 'invalid MSATS account' do
61
+ before(:each) do
62
+ AEMO::MSATS.authorize('NOTER', 'NOTER', 'NOTER')
63
+ end
64
+
65
+ it 'should return response' do
66
+ expect(AEMO::MSATS.c4(
67
+ '4001234567',
68
+ DateTime.now,
69
+ DateTime.now,
70
+ DateTime.now
71
+ ).class).to eq(HTTParty::Response)
72
+ end
43
73
  end
44
74
  end
45
75
 
46
76
  describe '#msats_limits' do
47
- before(:each) do
48
- AEMO::MSATS.authorize('ER', 'ER', 'ER')
77
+ describe 'valid MSATS user' do
78
+ before(:each) do
79
+ AEMO::MSATS.authorize('ER', 'ER', 'ER')
80
+ end
81
+
82
+ it 'should give details of msats_limits' do
83
+ expect(AEMO::MSATS.msats_limits.class).to eq(Hash)
84
+ end
49
85
  end
50
86
 
51
- it 'should give details of msats_limits' do
52
- expect(AEMO::MSATS.msats_limits.class).to eq(Hash)
87
+ describe 'invalid MSATS user' do
88
+ before(:each) do
89
+ AEMO::MSATS.authorize('NOTER', 'NOTER', 'NOTER')
90
+ end
91
+
92
+ it 'should not give details of msats_limits' do
93
+ expect(AEMO::MSATS.msats_limits.class).to eq(HTTParty::Response)
94
+ end
53
95
  end
54
96
  end
55
97
 
56
98
  describe '#nmi_discovery_by_*' do
57
- before(:each) do
58
- AEMO::MSATS.authorize('ER', 'ER', 'ER')
59
- end
60
- it 'should find by address' do
61
- expect(AEMO::MSATS.nmi_discovery_by_address('NSW', house_number: 6, street_name: 'Macquarie', suburb_or_place_or_locality: 'Sydney', postcode: 2000).class).to eq(Array)
62
- end
63
- it 'should find by meter_serial_number' do
64
- expect(AEMO::MSATS.nmi_discovery_by_meter_serial_number('NSW', 666).class).to eq(Array)
99
+ describe 'valid MSATS user' do
100
+ before(:each) do
101
+ AEMO::MSATS.authorize('ER', 'ER', 'ER')
102
+ end
103
+ it 'should find by address' do
104
+ expect(AEMO::MSATS.nmi_discovery_by_address('NSW', house_number: 6, street_name: 'Macquarie', suburb_or_place_or_locality: 'Sydney', postcode: 2000).class).to eq(Array)
105
+ end
106
+ it 'should find by meter_serial_number' do
107
+ expect(AEMO::MSATS.nmi_discovery_by_meter_serial_number('NSW', 666).class).to eq(Array)
108
+ end
109
+ it 'should find by meter_serial_number' do
110
+ expect { AEMO::MSATS.nmi_discovery_by_delivery_point_identifier('NSW', 666) }.to raise_error(ArgumentError)
111
+ end
112
+ it 'should find by meter_serial_number' do
113
+ expect(AEMO::MSATS.nmi_discovery_by_delivery_point_identifier('NSW', 10_000_001).class).to eq(Array)
114
+ end
65
115
  end
66
- it 'should find by meter_serial_number' do
67
- expect { AEMO::MSATS.nmi_discovery_by_delivery_point_identifier('NSW', 666) }.to raise_error(ArgumentError)
68
- end
69
- it 'should find by meter_serial_number' do
70
- expect(AEMO::MSATS.nmi_discovery_by_delivery_point_identifier('NSW', 10_000_001).class).to eq(Array)
116
+
117
+ describe 'invalid MSATS user' do
118
+ before(:each) do
119
+ AEMO::MSATS.authorize('NOTER', 'NOTER', 'NOTER')
120
+ end
121
+
122
+ it 'should find by address' do
123
+ expect(AEMO::MSATS.nmi_discovery_by_address('NSW', house_number: 6, street_name: 'Macquarie', suburb_or_place_or_locality: 'Sydney', postcode: 2000).class).to eq(HTTParty::Response)
124
+ end
125
+ it 'should find by meter_serial_number' do
126
+ expect(AEMO::MSATS.nmi_discovery_by_meter_serial_number('NSW', 666).class).to eq(HTTParty::Response)
127
+ end
128
+ it 'should find by meter_serial_number' do
129
+ expect(AEMO::MSATS.nmi_discovery_by_delivery_point_identifier('NSW', 10_000_001).class).to eq(HTTParty::Response)
130
+ end
71
131
  end
72
132
  end
73
133
 
74
134
  describe '#system_status' do
75
- before(:each) do
76
- AEMO::MSATS.authorize('ER', 'ER', 'ER')
135
+ describe 'valid MSATS user' do
136
+ before(:each) do
137
+ AEMO::MSATS.authorize('ER', 'ER', 'ER')
138
+ end
139
+
140
+ it 'should provide a status' do
141
+ AEMO::MSATS.system_status
142
+ end
77
143
  end
78
- it 'should provide a status' do
79
- AEMO::MSATS.system_status
144
+
145
+ describe 'invalid MSATS user' do
146
+ before(:each) do
147
+ AEMO::MSATS.authorize('NOTER', 'NOTER', 'NOTER')
148
+ end
149
+
150
+ it 'should provide a status' do
151
+ expect(AEMO::MSATS.system_status.class).to eq(HTTParty::Response)
152
+ end
80
153
  end
81
154
  end
82
155
  end
@@ -34,9 +34,9 @@ describe AEMO::NEM12 do
34
34
  end
35
35
 
36
36
  describe '#parse_nem12_200' do
37
- before(:each) do
38
- @nem12 = AEMO::NEM12.parse_nem12_100('100,NEM12,201603010000,CNRGYMDP,NEMMCO', strict: true)
39
- end
37
+ # before(:each) do
38
+ # @nem12 = AEMO::NEM12.parse_nem12_100('100,NEM12,201603010000,CNRGYMDP,NEMMCO', strict: true)
39
+ # end
40
40
  end
41
41
 
42
42
  describe '#parse_nem12_300' do
@@ -151,6 +151,11 @@ describe AEMO::NMI do
151
151
  nmi.address = { number: '1', street: 'Bob', street_type: 'Street' }
152
152
  expect(nmi.friendly_address).to eq('1, Bob, Street')
153
153
  end
154
+ it 'should return a friendly address if the address is a nested hash' do
155
+ nmi = AEMO::NMI.new('4001234567')
156
+ nmi.address = { house: { number: '1', suffix: 'B' }, street: 'Bob', street_type: 'Street', }
157
+ expect(nmi.friendly_address).to eq('1 B, Bob, Street')
158
+ end
154
159
  end
155
160
 
156
161
  describe '#current_daily_load' do
@@ -163,7 +168,7 @@ describe AEMO::NMI do
163
168
  describe '#current_annual_load' do
164
169
  it 'should return zero for no data' do
165
170
  @nmi = AEMO::NMI.new('4001234567')
166
- expect(@nmi.current_daily_load).to eq(0)
171
+ expect(@nmi.current_annual_load).to eq(0)
167
172
  end
168
173
  end
169
174
 
@@ -197,6 +202,11 @@ describe AEMO::NMI do
197
202
  expect(@nmi.dlfc_value.class).to eq(Float)
198
203
  end
199
204
  end
205
+ it 'has DLF values' do
206
+ Timecop.freeze('2016-06-01T00:00:00+1000') do
207
+ expect(@nmi.dlfc_values.class).to eq(Array)
208
+ end
209
+ end
200
210
  end
201
211
 
202
212
  describe 'transmission node identifiers and loss factors' do
@@ -214,6 +224,11 @@ describe AEMO::NMI do
214
224
  expect(@nmi.tni_value(DateTime.now).class).to eq(Float)
215
225
  end
216
226
  end
227
+ it 'has TNI values' do
228
+ Timecop.freeze('2016-06-01T00:00:00+1000') do
229
+ expect(@nmi.tni_values.class).to eq(Array)
230
+ end
231
+ end
217
232
  end
218
233
 
219
234
  describe 'MSATS functions' do
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,10 @@
1
1
  require 'coveralls'
2
2
  require 'simplecov'
3
- require 'pry'
4
3
  require 'webmock/rspec'
4
+ require 'pry'
5
5
  require 'timecop'
6
- require 'aemo'
7
6
 
8
7
  WebMock.disable_net_connect!(allow_localhost: true)
9
-
10
8
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
11
9
  [
12
10
  SimpleCov::Formatter::HTMLFormatter,
@@ -15,6 +13,8 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
15
13
  )
16
14
  SimpleCov.start
17
15
 
16
+ require 'aemo'
17
+
18
18
  RSpec.configure do |config|
19
19
  # WebMock
20
20
  config.before(:each) do
@@ -52,6 +52,23 @@ RSpec.configure do |config|
52
52
  .with(headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml' })
53
53
  .to_return(status: 200, body: File.new('spec/fixtures/MSATS/participant_system_status.xml'), headers: xml_headers)
54
54
  # MSATS ERRORS
55
+ # Invalid MSATS User
56
+ stub_request(:get, %r{msats.prod.nemnet.net.au\/msats\/ws\/C4\/NOTER})
57
+ .with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
58
+ .to_return(status: 404, body: '', headers: xml_headers)
59
+ stub_request(:get, %r{msats.prod.nemnet.net.au\/msats\/ws\/MSATSLimits\/NOTER})
60
+ .with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
61
+ .to_return(status: 404, body: '', headers: xml_headers)
62
+ stub_request(:get, %r{msats.prod.nemnet.net.au\/msats\/ws\/NMIDetail\/NOTER})
63
+ .with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
64
+ .to_return(status: 404, body: '', headers: xml_headers)
65
+ stub_request(:get, %r{msats.prod.nemnet.net.au\/msats\/ws\/NMIDiscovery\/NOTER})
66
+ .with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
67
+ .to_return(status: 404, body: '', headers: xml_headers)
68
+ stub_request(:get, %r{msats.prod.nemnet.net.au\/msats\/ws\/ParticipantSystemStatus\/NOTER})
69
+ .with(headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml' })
70
+ .to_return(status: 404, body: '', headers: xml_headers)
71
+ # Data errors
55
72
  stub_request(:get, %r{msats.prod.nemnet.net.au\/msats\/ws\/C4\/ER\?.+?NMI=4001234566.+?})
56
73
  .with(headers: { 'Accept' => ['text/xml'], 'Content-Type' => 'text/xml' })
57
74
  .to_return(status: 404, body: '', headers: xml_headers)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aemo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.33
4
+ version: 0.1.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Courtney
@@ -420,18 +420,19 @@ files:
420
420
  - lib/aemo/dispatchable.rb
421
421
  - lib/aemo/market.rb
422
422
  - lib/aemo/market/interval.rb
423
+ - lib/aemo/market/node.rb
423
424
  - lib/aemo/msats.rb
424
425
  - lib/aemo/nem12.rb
425
426
  - lib/aemo/nem13.rb
426
427
  - lib/aemo/nmi.rb
427
428
  - lib/aemo/region.rb
428
429
  - lib/aemo/version.rb
430
+ - lib/data/TNI-MLF-Codes.csv
429
431
  - lib/data/aemo-dlf-dnsp.csv
430
432
  - lib/data/aemo-dlf.json
431
433
  - lib/data/aemo-dlf.xml
432
434
  - lib/data/aemo-tni.json
433
435
  - lib/data/aemo-tni.xml
434
- - lib/data/tni-mlf-codes.csv
435
436
  - lib/data/xml_to_json.rb
436
437
  - spec/aemo_spec.rb
437
438
  - spec/fixtures/MSATS/c4.xml
@@ -545,6 +546,7 @@ files:
545
546
  - spec/fixtures/NEM12/nem12#SCENARIO10NEM1210183#ELECTDSM#NEMMCO
546
547
  - spec/fixtures/nmi_checksum.json
547
548
  - spec/lib/aemo/market/interval_spec.rb
549
+ - spec/lib/aemo/market/node_spec.rb
548
550
  - spec/lib/aemo/market_spec.rb
549
551
  - spec/lib/aemo/msats_spec.rb
550
552
  - spec/lib/aemo/nem12_spec.rb
@@ -689,6 +691,7 @@ test_files:
689
691
  - spec/fixtures/NEM12/nem12#SCENARIO10NEM1210183#ELECTDSM#NEMMCO
690
692
  - spec/fixtures/nmi_checksum.json
691
693
  - spec/lib/aemo/market/interval_spec.rb
694
+ - spec/lib/aemo/market/node_spec.rb
692
695
  - spec/lib/aemo/market_spec.rb
693
696
  - spec/lib/aemo/msats_spec.rb
694
697
  - spec/lib/aemo/nem12_spec.rb