示例#1
0
    def test_modify_log_file(self):
        """Test writing a new log file then reverting that change."""
        test_log_file = "logs/test.log"

        # Get initial config
        config = lib.get_config()
        orig_log_file = config["logging"]["log_file"]

        # Modify config
        config["logging"]["log_file"] = test_log_file
        lib.write_config(config)

        # Get and check updated config
        updated_config = lib.get_config()
        assert updated_config == config
        assert updated_config["logging"]["log_file"] == test_log_file

        # Revert change
        config["logging"]["log_file"] = orig_log_file
        lib.write_config(config)

        # Test reverted change
        updated_config = lib.get_config()
        assert updated_config == config
        assert updated_config["logging"]["log_file"] == orig_log_file
示例#2
0
    def test_modify_log_file(self):
        """Test writing a new log file then reverting that change."""
        test_log_file = "logs/test.log"

        # Get initial config
        config = lib.get_config()
        orig_log_file = config["logging"]["log_file"]

        # Modify config
        config["logging"]["log_file"] = test_log_file
        lib.write_config(config)

        # Get and check updated config
        updated_config = lib.get_config()
        assert updated_config == config
        assert updated_config["logging"]["log_file"] == test_log_file

        # Revert change
        config["logging"]["log_file"] = orig_log_file
        lib.write_config(config)

        # Test reverted change
        updated_config = lib.get_config()
        assert updated_config == config
        assert updated_config["logging"]["log_file"] == orig_log_file
示例#3
0
 def test_same(self):
     """Confirm that writing without changes produces no change."""
     config = lib.get_config()
     lib.write_config(config)
     result_config = lib.get_config()
     assert config == result_config
示例#4
0
 def test_same(self):
     """Confirm that writing without changes produces no change."""
     config = lib.get_config()
     lib.write_config(config)
     result_config = lib.get_config()
     assert config == result_config