def test_creates_config_file(self): with flake.environment('config stuff', 'foo', 'foo/bar.py') as env: assert open(env.config_filename).read() == 'config stuff'
def test_cleans_up(self): with flake.environment('config stuff', 'foo', 'foo/bar.py') as env: pass assert not os.path.exists(env.config_filename) assert not os.path.exists(env.filename)
def test_creates_check_file(self, filename): content = binascii.hexlify(os.urandom(32)).decode('utf8') with flake.environment('config stuff', content, filename) as env: assert open(env.filename).read() == content