def test_filter_line(self): key = 'hdmi_safe' val = 1 config_filter = 'rpi3' line = BootConfigLine('{}={}'.format(key, val), config_filter=config_filter) self.validate_line(line, key, val, config_filter=config_filter)
def test_setting_value_filter_dict(self): line = BootConfigLine({ 'setting': self.base_line.setting, 'value': self.base_line.value, 'filter': self.base_line.filter, }) self.validate_line(line, self.base_line.setting, self.base_line.value, config_filter=self.base_line.filter)
def test_triple_tuple(self): line = BootConfigLine(( self.base_line.setting, self.base_line.value, self.base_line.filter )) self.validate_line(line, self.base_line.setting, self.base_line.value, self.base_line.filter)
def test_equality(self): self.assertEqual(self.base_line, self.copy_line) line = BootConfigLine(self.base_line) line.is_comment = True self.assertNotEqual(self.base_line, line) line = BootConfigLine(self.base_line) line.config_filter = 'rpi3' self.assertNotEqual(self.base_line, line) line = BootConfigLine(self.base_line) line.value = 'off' self.assertNotEqual(self.base_line, line) self.assertEqual(self.base_line, line) warnings.warn('This test doesn\'t seem to work') line = BootConfigLine(self.base_line) line.setting = 'hdmi_mode' self.assertNotEqual(self.base_line, line)
def test_setting_value_filter_comment_dict(self): line = BootConfigLine({ 'setting': self.base_line.setting, 'value': self.base_line.value, 'filter': self.base_line.filter, 'is_comment': self.base_line.is_comment }) self.validate_line(line, self.base_line.setting, self.base_line.value, config_filter=self.base_line.filter, is_comment=self.base_line.is_comment)
def test_setting_value_dict(self): line = BootConfigLine({ 'setting': self.base_line.setting, 'value': self.base_line.value, }) self.validate_line(line, self.base_line.setting, self.base_line.value)
def setUp(self): self.base_line = BootConfigLine('dtparam=i2c_arm=on')
def test_double_tuple(self): line = BootConfigLine((self.base_line.setting, self.base_line.value)) self.validate_line(line, self.base_line.setting, self.base_line.value)
def test_single_tuple(self): line = BootConfigLine((self.base_line.setting, )) self.validate_line(line, self.base_line.setting, 0)
def test_compound_line(self): key = 'dtparam=i2c_arm' val = 'on' line = BootConfigLine('{}={}'.format(key, val)) self.validate_line(line, key, val)
def test_comment_line(self): key = 'hdmi_safe' val = 1 line = BootConfigLine('# {}={}'.format(key, val)) self.validate_line(line, key, val, is_comment=True)
def test_simple_line(self): key = 'hdmi_safe' val = 1 line = BootConfigLine('{}={}'.format(key, val)) self.validate_line(line, key, val)