Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jun 25, 2024
1 parent 345e5bf commit b8180a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion service/lib/agama/product_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def initialize(logger: nil)
def load_products
glob = File.join(default_path, "*.{yaml,yml}")
Dir.glob(glob).each_with_object([]) do |path, result|
products = YAML.safe_load_file(path)
products = YAML.safe_load(File.read(path))
products = [products] unless products.is_a?(Array)
result.concat(products)
end
Expand Down
16 changes: 16 additions & 0 deletions service/test/agama/software/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
describe "#probe" do
before do
subject.select_product("Tumbleweed")
allow(subject).to receive(:list_disks).and_return({})
end

it "creates a packages proposal" do
Expand All @@ -228,6 +229,21 @@
subject.probe
end

it "uses the offline medium if available" do
device = "/dev/sr1"
expect(subject).to receive(:list_disks).and_return({
"blockdevices" => [
{
"kname" => device,
"label" => "openSUSE-Tumbleweed-DVD-x86_64"
}
]
})

expect(repositories).to receive(:add).with("hd:/?device=" + device)
subject.probe
end

include_examples "software issues", "probe"
end

Expand Down

0 comments on commit b8180a8

Please sign in to comment.