Beispiel #1
0
    def test_persist_read_error(self):
        # bad section
        content = """
        [Web
        port=88
        """
        with self.assertRaises(PersistError):
            Config.from_str(content)

        # bad value
        content = """
        [Web]
        port88
        """
        with self.assertRaises(PersistError):
            Config.from_str(content)

        # bad line
        content = """
        [Web]
        port=88
        what am i doing here
        """
        with self.assertRaises(PersistError):
            Config.from_str(content)