def test_use_ticket_key_as_ticket_detail(self): # pylint: disable=invalid-name self.maxDiff = None self.assertEqual( [ ConfigItem("site", "1.1.1.1"), ConfigItem('expire', '300'), ConfigItem('site', '2.2.2.2'), ConfigItem('arbitrator', '3.3.3.3'), ConfigItem("ticket", "TA", [ ConfigItem("timeout", "10"), ConfigItem('--nonexistent', 'value'), ConfigItem("expire", "300"), ]), ConfigItem("ticket", "TB", [ ConfigItem("timeout", "20"), ConfigItem("renewal-freq", "40"), ]), ], # testing a function which should not be used outside of the module # pylint: disable=protected-access config_parser._organize_lines([ ("site", "1.1.1.1"), ("expire", "300"), # out of ticket content is kept global ("ticket", "TA"), ("site", "2.2.2.2"), # move to global ("timeout", "10"), ("--nonexistent", "value"), # no global is kept under ticket ("expire", "300"), ("ticket", "TB"), ('arbitrator', '3.3.3.3'), ("timeout", "20"), ("renewal-freq", "40"), ]))
def test_move_non_ticket_config_keys_above_tickets(self): self.assertEqual( [ ConfigItem("site", "1.1.1.1"), ConfigItem('site', '2.2.2.2'), ConfigItem('arbitrator', '3.3.3.3'), ConfigItem("ticket", "TA"), ], # testing a function which should not be used outside of the module # pylint: disable=protected-access config_parser._organize_lines([ ("site", "1.1.1.1"), ("ticket", "TA"), ('site', '2.2.2.2'), ('arbitrator', '3.3.3.3'), ]))