Exemplo n.º 1
0
    def test_update(self):
        """
        GIVEN -
        WHEN modifiying the default config
        THEN it's not persisted until .save() is called
        """
        config = Config()
        config.default_instance = "custom"

        assert Config().default_instance != "custom"

        config.save()

        assert Config().default_instance == "custom"
Exemplo n.º 2
0
    def test_save_file_not_existing(self):
        """
        GIVEN a config object and the auth config file not existing
        WHEN saving the config
        THEN it works and when loading the config again it has the correct values
        """
        config = Config()
        try:
            os.remove(get_auth_config_filepath())
        except FileNotFoundError:
            pass

        config.default_instance = "custom"
        config.save()
        updated_config = Config()

        assert updated_config.default_instance == "custom"