Exemplo n.º 1
0
 def test_counts_secondary_files(self):
     file = self.make_file(1000)
     file['secondaryFiles'] = [
         self.make_file(100),
         self.make_file(200),
         self.make_file(300)
     ]
     self.assertEqual(total_size(file), 1600)
Exemplo n.º 2
0
 def test_counts_in_array(self):
     outputs = {
         'files':
         [self.make_file(100),
          self.make_file(200),
          self.make_file(300)]
     }
     self.assertEqual(total_size(outputs), 600)
Exemplo n.º 3
0
 def test_counts_nested(self):
     outputs = {
         'files':
         [self.make_file(100),
          self.make_file(200),
          self.make_file(300)],
         'things': {
             'nested_files': [
                 self.make_file(1000),
                 self.make_file(2000),
                 self.make_file(3000)
             ]
         }
     }
     self.assertEqual(total_size(outputs), 6600)
Exemplo n.º 4
0
 def test_defaults_zero_when_no_size(self):
     file = self.make_file()
     self.assertNotIn('size', file)
     self.assertEqual(total_size(file), 0)
Exemplo n.º 5
0
 def test_total_size_file_objects(self):
     outputs = {
         'file1': self.make_file(100, 'file1'),
         'file2': self.make_file(200, 'file2')
     }
     self.assertEqual(total_size(outputs), 300)
Exemplo n.º 6
0
 def test_total_size_direct(self):
     file = self.make_file(100)
     self.assertEqual(total_size(file), 100)