コード例 #1
0
 def test_size_nonint(self):
     with self.assertRaises(ValueError):
         get_size(["--size", "abc"])
コード例 #2
0
 def test_get_size(self):
     self.assertEqual(get_size(["--size", "1912", "blueprint", "type"]),
                      (["blueprint", "type"], 2004877312))
コード例 #3
0
 def test_size_no_value(self):
     with self.assertRaises(RuntimeError):
         get_size(["--size"])
コード例 #4
0
 def test_size_later(self):
     self.assertEqual(get_size(["start", "--size", "100", "type"]),
                      (["start", "type"], 104857600))
コード例 #5
0
 def test_no_size(self):
     self.assertEqual(
         get_size(["blueprint", "type", "imagename", "profile"]),
         (["blueprint", "type", "imagename", "profile"], 0))
コード例 #6
0
 def test_empty(self):
     self.assertEqual(get_size([]), ([], 0))
コード例 #7
0
 def test_size_later(self):
     with self.assertRaises(RuntimeError):
         get_size(["blueprint", "--size", "100", "type"])