def test_initialize_config(self, tmpdir): tmpfile = tmpdir.join("openmoves.cfg") openmoves.initialize_config(tmpfile) lines = tmpfile.readlines() assert len(lines) == 1 assert re.match(r"SECRET_KEY = '[a-f0-9]{64}'", lines[0]), "unexpected line: %s" % lines[0]
def test_initialize_config_subsequent_calls_differ(self, tmpdir): tmpfile1 = tmpdir.join("openmoves1.cfg") tmpfile2 = tmpdir.join("openmoves2.cfg") openmoves.initialize_config(tmpfile1) openmoves.initialize_config(tmpfile2) assert tmpfile1.read() != tmpfile2.read()