Skip to content

Commit

Permalink
Fix tests for IRLP importer.
Browse files Browse the repository at this point in the history
  • Loading branch information
pupeno committed Nov 3, 2023
1 parent 06a64c6 commit 181d3a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/importers/irlp_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def import_repeater(raw_repeater)
if call_sign.blank? || call_sign == "*"
@logger.info "Ignoring repeater since the call sign is #{raw_repeater["CallSign"]}"
return [:ignored_due_to_broken_record, nil]
elsif call_sign == "K5NX" && raw_repeater["Freq"] == "157.5600"
@logger.info "Ignoring repeater since frequency is outside the band plan #{raw_repeater["CallSign"]}"
return [:ignored_due_to_broken_record, nil]
end

tx_frequency = raw_repeater["Freq"].to_f.abs * 10**6 # Yes, there's a repeater with negative frequency.
Expand Down
Binary file modified spec/factories/irlp_importer_data/irlp.tsv.bz2
Binary file not shown.
4 changes: 2 additions & 2 deletions spec/lib/importers/irlp_importer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Dir.mktmpdir("IrlpImporter") do |dir|
expect do
IrlpImporter.new(working_directory: dir).import
end.to change { Repeater.count }.by(929)
end.to change { Repeater.count }.by(915)

# Grab some repeaters and verify they were imported correctly.
repeater = Repeater.find_sole_by(call_sign: "VE7ISC")
Expand All @@ -40,7 +40,7 @@
expect(repeater.rx_frequency).to eq(146_040_000)

# Check a case where we get multiple repeaters with the same call sign.
expect(Repeater.where(call_sign: "K5NX").count).to eq(4)
expect(Repeater.where(call_sign: "K5NX").count).to eq(2)
end
end

Expand Down

0 comments on commit 181d3a0

Please sign in to comment.