Merge lp:~trapnine/maas/fix-1509535 into lp:~maas-committers/maas/trunk

Proposed by Jeffrey C Jones
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 4466
Proposed branch: lp:~trapnine/maas/fix-1509535
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 36 lines (+26/-0)
1 file modified
src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js (+26/-0)
To merge this branch: bzr merge lp:~trapnine/maas/fix-1509535
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+276698@code.launchpad.net

Commit message

Add corresponding test for createPartition.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js'
--- src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js 2015-11-04 19:14:20 +0000
+++ src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js 2015-11-04 20:46:43 +0000
@@ -2312,6 +2312,32 @@
2312 node, disk.block_id, 2.6 * 1000 * 1000 * 1000);2312 node, disk.block_id, 2.6 * 1000 * 1000 * 1000);
2313 });2313 });
23142314
2315 // regression test for https://bugs.launchpad.net/maas/+bug/1509535
2316 it("calls createPartition with available_size bytes" +
2317 " even when human size gets rounded down", function() {
2318
2319 var controller = makeController();
2320 var disk = {
2321 block_id: makeInteger(0, 100),
2322 original: {
2323 partition_table_type: "mbr",
2324 available_size: 2.035 * 1000 * 1000 * 1000,
2325 available_size_human: "2.0 GB",
2326 block_size: 512
2327 },
2328 $options: {
2329 size: "2.0",
2330 sizeUnits: "GB"
2331 }
2332 };
2333 spyOn(NodesManager, "createPartition");
2334
2335 $scope.availableConfirmPartition(disk);
2336
2337 expect(NodesManager.createPartition).toHaveBeenCalledWith(
2338 node, disk.block_id, 2.035 * 1000 * 1000 * 1000);
2339 });
2340
2315 it("calls createPartition with bytes minus partition table extra",2341 it("calls createPartition with bytes minus partition table extra",
2316 function() {2342 function() {
2317 var controller = makeController();2343 var controller = makeController();