# -*- coding: utf-8 -*-


import pytest
from s3keyring.s3 import S3Keyring


@pytest.fixture
def config(scope='module'):
    return S3Keyring().config


def test_read_config(config):
    """Sets value for an existing configuration option"""
    profile_name = config.get('default', 'profile')
    assert profile_name == 'default'


def test_write_config(config):
    config.set('default', 'dummyparam', 'anothervalue')
    config.save()
    config.load()
    assert config.get('default', 'dummyparam') == 'anothervalue'

@@ -33,16 +33,28 @@
  pytest%0A
+import uuid%0A
 from s3k
@@ -158,16 +158,225 @@
 onfig%0A%0A%0A
+@pytest.yield_fixture%0Adef dummyparam(config, scope='module'):%0A    yield 'dummyparam'%0A    config.config.remove_option('default', 'dummyparam')%0A%0A%0A@pytest.fixture%0Adef dummyvalue():%0A    return str(uuid.uuid4())%0A%0A%0A
 def test
@@ -570,24 +570,48 @@
 onfig(config
+, dummyparam, dummyvalue
 ):%0A    confi
@@ -619,33 +619,32 @@
 .set('default', 
-'
 dummyparam', 'an
@@ -641,25 +641,20 @@
 aram
-'
 , 
-'another
+dummy
 value
-'
 )%0A  
@@ -712,33 +712,32 @@
 .get('default', 
-'
 dummyparam') == 
@@ -734,25 +734,20 @@
 aram
-'
 ) == 
-'another
+dummy
 value
-'
 %0A

Make test_config idempotent