aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/hwpack/tests/test_hwpack_converter.py
diff options
context:
space:
mode:
Diffstat (limited to 'linaro_image_tools/hwpack/tests/test_hwpack_converter.py')
-rw-r--r--linaro_image_tools/hwpack/tests/test_hwpack_converter.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/linaro_image_tools/hwpack/tests/test_hwpack_converter.py b/linaro_image_tools/hwpack/tests/test_hwpack_converter.py
index 3e830da..4f83994 100644
--- a/linaro_image_tools/hwpack/tests/test_hwpack_converter.py
+++ b/linaro_image_tools/hwpack/tests/test_hwpack_converter.py
@@ -166,3 +166,18 @@ class HwpackConverterTests(TestCaseWithFixtures):
converter = HwpackConverter(input_file, output_file)
converter._parse()
self.assertEqual(out_format, str(converter))
+
+ def test_mmc_id(self):
+ """Test correct handling of mmc_id field.
+
+ The mmc_id field has to be quoted coming out from the converter
+ otherwise when reading the yaml file the value is read as a number,
+ not a string."""
+ ini_format = ("[hwpack]\nformat=2.0\nmmc_id=1:1")
+ out_format = ("format: '3.0'\nmmc_id: '1:1'\n")
+ input_file = self.useFixture(CreateTempFileFixture(ini_format)).\
+ get_file_name()
+ output_file = self.useFixture(CreateTempFileFixture()).get_file_name()
+ converter = HwpackConverter(input_file, output_file)
+ converter._parse()
+ self.assertEqual(out_format, str(converter))