Skip to content

Commit

Permalink
Fix conf.write_initial_config() to use read_file() instead of depreca…
Browse files Browse the repository at this point in the history
…ted readfp()
  • Loading branch information
dmach committed Nov 15, 2023
1 parent 526adc3 commit 1daa560
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,5 +469,22 @@ def test_email(self):
self.assertEqual(self.host_options.email, "[email protected]")


class TestConf(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp(prefix="osc_test_")

def tearDown(self):
shutil.rmtree(self.tmpdir)

def test_write_initial_config(self):
conffile = os.path.join(self.tmpdir, "oscrc")
entries = {
"user": "Admin",
"pass": "opensuse",
"apiurl": "https://example.com",
}
osc.conf.write_initial_config(conffile, entries)


if __name__ == "__main__":
unittest.main()

0 comments on commit 1daa560

Please sign in to comment.