Пример #1
0
 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'
Пример #2
0
 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)
Пример #3
0
 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
Пример #4
0
 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)
Пример #5
0
 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
Пример #6
0
 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'