-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conf.write_initial_config() to use read_file() instead of depreca…
…ted readfp()
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() |