~mpontillo/maas/dns-template-changes-1.7

« back to all changes in this revision

Viewing changes to src/maasserver/models/tests/test_bootresourceset.py

  • Committer: MaaS Lander
  • Author(s): Raphael Badin
  • Date: 2014-10-17 16:21:20 UTC
  • mfrom: (3263.2.1 revert-r-3263)
  • Revision ID: maas_lander-20141017162120-2f1sa7apve0uiryq
[r=andreserl][bug=][author=rvb] Revert revision 3263;  this change broke the CI: nodes cannot be commissioned (no-such-image error) with this change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
            resource_set, largefile, filename=filetype, filetype=filetype)
133
133
        self.assertEqual(0, resource_set.progress)
134
134
 
135
 
    def test_progress_increases_from_0_to_100(self):
 
135
    def test_progress_increases_from_0_to_1(self):
136
136
        resource = factory.make_BootResource()
137
137
        resource_set = factory.make_BootResourceSet(resource)
138
138
        filetype = BOOT_RESOURCE_FILE_TYPE.ROOT_IMAGE
149
149
            stream.write(b"a")
150
150
            current_size += 1
151
151
            self.assertAlmostEqual(
152
 
                100.0 * current_size / float(total_size),
 
152
                total_size / float(current_size),
153
153
                resource_set.progress)
154
154
 
155
155
    def test_progress_accumulates_all_files(self):
174
174
                content=content, size=total_size)
175
175
            factory.make_BootResourceFile(
176
176
                resource_set, largefile, filename=filetype, filetype=filetype)
177
 
        progress = 100.0 * final_size / float(final_total_size)
 
177
        progress = final_total_size / float(final_size)
178
178
        self.assertAlmostEqual(progress, resource_set.progress)
179
179
 
180
180
    def test_complete_returns_false_for_no_files(self):